Skip to content

Commit 3c20c66

Browse files
committed
add js tests
1 parent 010fe9e commit 3c20c66

File tree

11 files changed

+2077
-25
lines changed

11 files changed

+2077
-25
lines changed

tokens/spl-token-minter/steel/api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ pub mod prelude {
1515
use steel::*;
1616

1717
// TODO Set program id
18-
declare_id!("z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35");
18+
declare_id!("8V26fyhrQobKbvkRCV3KvT6jZQLzviovdARfGrw8kUdG");

tokens/spl-token-minter/steel/api/src/sdk.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::prelude::*;
44

55
pub fn create(
66
payer: Pubkey,
7-
mint_authority: Pubkey,
87
token_name: [u8; 32],
98
token_symbol: [u8; 8],
109
token_uri: [u8; 64],
@@ -24,7 +23,6 @@ pub fn create(
2423
accounts: vec![
2524
AccountMeta::new(payer, true),
2625
AccountMeta::new(mint_pda.0, false),
27-
AccountMeta::new(mint_authority, false),
2826
AccountMeta::new(metadata_pda.0, false),
2927
AccountMeta::new_readonly(system_program::ID, false),
3028
AccountMeta::new_readonly(spl_token::ID, false),
@@ -40,21 +38,19 @@ pub fn create(
4038
}
4139
}
4240
pub fn mint(
43-
signer: Pubkey,
41+
mint_authority: Pubkey,
4442
recipient: Pubkey,
4543
associated_token_account: Pubkey,
46-
authority: Pubkey,
4744
quantity: u64,
4845
) -> Instruction {
4946
let mint_pda = Pubkey::find_program_address(&[MINT, MINT_NOISE.as_slice()], &crate::ID);
5047
Instruction {
5148
program_id: crate::ID,
5249
accounts: vec![
53-
AccountMeta::new(signer, true),
50+
AccountMeta::new(mint_authority, true),
5451
AccountMeta::new(recipient, false),
5552
AccountMeta::new(mint_pda.0, false),
5653
AccountMeta::new(associated_token_account, false),
57-
AccountMeta::new(authority, false),
5854
AccountMeta::new_readonly(spl_token::ID, false),
5955
AccountMeta::new_readonly(spl_associated_token_account::ID, false),
6056
AccountMeta::new_readonly(system_program::ID, false),
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# This script is for quick building & deploying of the program.
4+
# It also serves as a reference for the commands used for building & deploying Solana programs.
5+
# Run this bad boy with "bash cicd.sh" or "./cicd.sh"
6+
7+
cargo build-sbf --manifest-path=./program/Cargo.toml
8+
solana program deploy ./program/target/deploy/program.so
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"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.73.0",
9+
"borsh": "^0.7.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": "^4.3.5"
21+
}
22+
}

0 commit comments

Comments
 (0)