Skip to content

Commit 08540e2

Browse files
authored
p-token: Add scripts (#27)
* Update workspace * Rename interface crate * Add readme * Update cargo lock * Update workspace * Fix spelling * Fix clippy warning * Fix p-token binary name * Add p-token scripts
1 parent 52ee7f2 commit 08540e2

24 files changed

+26
-24
lines changed

Diff for: interface/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ This will add the `spl-token-interface` dependency to your `Cargo.toml` file.
2222

2323
## Documentation
2424

25-
Read more about the SPL Token program on the crate [documentation](https://docs.rs/spl-token-interface).
25+
Read more about the SPL Token interface on the crate [documentation](https://docs.rs/spl-token-interface).

Diff for: p-token/tests/amount_to_ui_amount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use solana_sdk::{pubkey::Pubkey, signature::Signer, transaction::Transaction};
99
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1010
#[tokio::test]
1111
async fn amount_to_ui_amount(token_program: Pubkey) {
12-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
12+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1313
.start_with_context()
1414
.await;
1515

Diff for: p-token/tests/approve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn approve(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/approve_checked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn approve_checked(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/burn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn burn(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/burn_checked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn burn_checked(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/close_account.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use solana_sdk::{
1313
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1414
#[tokio::test]
1515
async fn close_account(token_program: Pubkey) {
16-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
16+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1717
.start_with_context()
1818
.await;
1919

Diff for: p-token/tests/freeze_account.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use spl_token::state::AccountState;
1515
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1616
#[tokio::test]
1717
async fn freeze_account(token_program: Pubkey) {
18-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
18+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1919
.start_with_context()
2020
.await;
2121

Diff for: p-token/tests/initialize_account.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use solana_sdk::{
1515
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1616
#[tokio::test]
1717
async fn initialize_account(token_program: Pubkey) {
18-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
18+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1919
.start_with_context()
2020
.await;
2121

Diff for: p-token/tests/initialize_account2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use solana_sdk::{
1515
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1616
#[tokio::test]
1717
async fn initialize_account2(token_program: Pubkey) {
18-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
18+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1919
.start_with_context()
2020
.await;
2121

Diff for: p-token/tests/initialize_account3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use solana_sdk::{
1515
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1616
#[tokio::test]
1717
async fn initialize_account3(token_program: Pubkey) {
18-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
18+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1919
.start_with_context()
2020
.await;
2121

Diff for: p-token/tests/initialize_mint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use spl_token_interface::state::mint::Mint;
1919
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
2020
#[tokio::test]
2121
async fn initialize_mint(token_program: Pubkey) {
22-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
22+
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
2323
.start_with_context()
2424
.await;
2525

Diff for: p-token/tests/initialize_mint2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use spl_token_interface::state::mint::Mint;
1919
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
2020
#[tokio::test]
2121
async fn initialize_mint2(token_program: Pubkey) {
22-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
22+
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
2323
.start_with_context()
2424
.await;
2525

Diff for: p-token/tests/initialize_multisig.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use spl_token::state::Multisig;
1616
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1717
#[tokio::test]
1818
async fn initialize_multisig(token_program: Pubkey) {
19-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
19+
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
2020
.start_with_context()
2121
.await;
2222

Diff for: p-token/tests/initialize_multisig2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use spl_token::state::Multisig;
1616
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1717
#[tokio::test]
1818
async fn initialize_multisig2(token_program: Pubkey) {
19-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
19+
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
2020
.start_with_context()
2121
.await;
2222

Diff for: p-token/tests/mint_to.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn mint_to(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/mint_to_checked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn mint_to_checked(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/revoke.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn revoke(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/set_authority.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use spl_token::instruction::AuthorityType;
1616
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1717
#[tokio::test]
1818
async fn set_authority(token_program: Pubkey) {
19-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
19+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
2020
.start_with_context()
2121
.await;
2222

Diff for: p-token/tests/thaw_account.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use spl_token::state::AccountState;
1515
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1616
#[tokio::test]
1717
async fn thaw_account(token_program: Pubkey) {
18-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
18+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1919
.start_with_context()
2020
.await;
2121

Diff for: p-token/tests/transfer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn transfer(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/transfer_checked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_sdk::{
1414
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1515
#[tokio::test]
1616
async fn transfer_checked(token_program: Pubkey) {
17-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
17+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1818
.start_with_context()
1919
.await;
2020

Diff for: p-token/tests/ui_amount_to_amount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use solana_sdk::{pubkey::Pubkey, signature::Signer, transaction::Transaction};
99
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
1010
#[tokio::test]
1111
async fn ui_amount_to_amount(token_program: Pubkey) {
12-
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
12+
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
1313
.start_with_context()
1414
.await;
1515

Diff for: package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"rust:spellcheck": "cargo spellcheck --code 1",
2424
"rust:audit": "zx ./scripts/rust/audit.mjs",
2525
"rust:publish": "zx ./scripts/rust/publish.mjs",
26-
"rust:semver": "cargo semver-checks"
26+
"rust:semver": "cargo semver-checks",
27+
"p-token:build": "zx ./scripts/rust/build-sbf.mjs p-token",
28+
"p-token:test": "zx ./scripts/rust/test-sbf.mjs p-token"
2729
},
2830
"devDependencies": {
2931
"@codama/renderers-js": "^1.2.7",

0 commit comments

Comments
 (0)