Skip to content

Commit 7e76536

Browse files
committed
test(tokens): migrate token-minter, transfer-tokens, nft-minter, pda-mint-authority natives to mpl 5.x + LiteSVM
Migrate the four Metaplex-using native token examples off the old mpl-token-metadata 1.x / system_instruction / spl-token APIs onto the current toolchain, matching the create-token reference: - mpl-token-metadata 5.x builders (CreateMetadataAccountV3, CreateMasterEditionV3) bridged from the older solana-program types the builders return via a shared bridge.rs (to_mpl / bridge_instruction). - solana-system-interface for create_account. - spl-token-interface + spl-associated-token-account-interface 2.0.0. - transfer-tokens now uses transfer_checked (reads mint decimals). - Add each crate to the root workspace members and remove from .ghaignore. - Add LiteSVM Rust tests (program/tests/test.rs) loading the program plus the committed mpl_token_metadata.so fixture, exercising create/mint/ transfer/master-edition/PDA-authority flows end to end with assertions. - Replace package.json with scripts-only, delete devnet TS tests + tsconfig, regenerate empty pnpm lockfiles. https://claude.ai/code/session_013dpnF6uSGWXjkJJZseqzcP
1 parent 3bd06fb commit 7e76536

54 files changed

Lines changed: 1140 additions & 8686 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.ghaignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# uses generated client from shank, can't rewrite to solana-bankrun
22
tools/shank-and-solita/native
33

4-
# can't test on localnet
5-
tokens/pda-mint-authority/native
6-
tokens/nft-minter/native
7-
tokens/transfer-tokens/native
8-
tokens/token-minter/native
9-
104
# not building: pyth-solana-receiver-sdk 1.1.0 pulls a borsh version that
115
# conflicts with Anchor 1.0 / Solana 3.x (PriceUpdateV2 fails BorshDeserialize).
126
# Blocked on an upstream SDK release compatible with solana 3.x.

Cargo.lock

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ members = [
5959
"tokens/token-extensions/transfer-fee/native/program",
6060
"tokens/token-extensions/multiple-extensions/native/program",
6161
"tokens/create-token/native/program",
62+
"tokens/token-minter/native/program",
63+
"tokens/transfer-tokens/native/program",
64+
"tokens/nft-minter/native/program",
65+
"tokens/pda-mint-authority/native/program",
6266
]
6367
resolver = "2"
6468

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
{
22
"scripts": {
3-
"test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts"
4-
},
5-
"dependencies": {
6-
"@metaplex-foundation/mpl-token-metadata": "^2.5.2",
7-
"@solana/spl-token": "^0.3.7",
8-
"@solana/web3.js": "^1.98.4",
9-
"borsh": "^2.0.0",
10-
"buffer": "^6.0.3",
11-
"fs": "^0.0.1-security"
12-
},
13-
"devDependencies": {
14-
"@types/bn.js": "^5.1.0",
15-
"@types/chai": "^4.3.1",
16-
"@types/mocha": "^9.1.1",
17-
"chai": "^4.3.4",
18-
"mocha": "^9.0.3",
19-
"ts-mocha": "^10.0.0",
20-
"typescript": "^5"
3+
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures",
4+
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
5+
"deploy": "solana program deploy ./program/target/so/nft_minter_program.so"
216
}
227
}

0 commit comments

Comments
 (0)