Skip to content

p-token: Add scripts #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ This will add the `spl-token-interface` dependency to your `Cargo.toml` file.

## Documentation

Read more about the SPL Token program on the crate [documentation](https://docs.rs/spl-token-interface).
Read more about the SPL Token interface on the crate [documentation](https://docs.rs/spl-token-interface).
2 changes: 1 addition & 1 deletion p-token/tests/amount_to_ui_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use solana_sdk::{pubkey::Pubkey, signature::Signer, transaction::Transaction};
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn amount_to_ui_amount(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/approve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn approve(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/approve_checked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn approve_checked(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn burn(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/burn_checked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn burn_checked(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/close_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn close_account(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/freeze_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use spl_token::state::AccountState;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn freeze_account(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_account(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_account2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_account2(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_account3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_account3(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use spl_token_interface::state::mint::Mint;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_mint(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_mint2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use spl_token_interface::state::mint::Mint;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_mint2(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use spl_token::state::Multisig;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_multisig(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/initialize_multisig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use spl_token::state::Multisig;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn initialize_multisig2(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/mint_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn mint_to(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/mint_to_checked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn mint_to_checked(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/revoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn revoke(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/set_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use spl_token::instruction::AuthorityType;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn set_authority(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/thaw_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use spl_token::state::AccountState;
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn thaw_account(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn transfer(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/transfer_checked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use solana_sdk::{
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn transfer_checked(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
2 changes: 1 addition & 1 deletion p-token/tests/ui_amount_to_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use solana_sdk::{pubkey::Pubkey, signature::Signer, transaction::Transaction};
#[test_case::test_case(TOKEN_PROGRAM_ID ; "p-token")]
#[tokio::test]
async fn ui_amount_to_amount(token_program: Pubkey) {
let mut context = ProgramTest::new("token_program", TOKEN_PROGRAM_ID, None)
let mut context = ProgramTest::new("pinocchio_token_program", TOKEN_PROGRAM_ID, None)
.start_with_context()
.await;

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"rust:spellcheck": "cargo spellcheck --code 1",
"rust:audit": "zx ./scripts/rust/audit.mjs",
"rust:publish": "zx ./scripts/rust/publish.mjs",
"rust:semver": "cargo semver-checks"
"rust:semver": "cargo semver-checks",
"p-token:build": "zx ./scripts/rust/build-sbf.mjs p-token",
"p-token:test": "zx ./scripts/rust/test-sbf.mjs p-token"
},
"devDependencies": {
"@codama/renderers-js": "^1.2.7",
Expand Down