diff --git a/tests/bench/tests/compute-units.ts b/tests/bench/tests/compute-units.ts index 3465bcf1b8..f1492caff9 100644 --- a/tests/bench/tests/compute-units.ts +++ b/tests/bench/tests/compute-units.ts @@ -121,7 +121,7 @@ describe("Compute units", () => { const mintKp = new anchor.web3.Keypair(); mintPk = mintKp.publicKey; const createMintIx = await tokenProgram.account.mint.createInstruction( - mintKp + mintPk ); const initMintIx = await tokenProgram.methods .initializeMint2(0, owner, null) @@ -133,7 +133,7 @@ describe("Compute units", () => { const tokenKp = new anchor.web3.Keypair(); tokenPk = tokenKp.publicKey; const createTokenIx = await tokenProgram.account.account.createInstruction( - tokenKp + tokenPk ); const initTokenIx = await tokenProgram.methods .initializeAccount3(owner) diff --git a/tests/cashiers-check/tests/cashiers-check.js b/tests/cashiers-check/tests/cashiers-check.js index a5edd096e2..1534dc0a9a 100644 --- a/tests/cashiers-check/tests/cashiers-check.js +++ b/tests/cashiers-check/tests/cashiers-check.js @@ -57,7 +57,7 @@ describe("cashiers-check", () => { }, signers: [check, vault], instructions: [ - await program.account.check.createInstruction(check, 300), + await program.account.check.createInstruction(check.publicKey, 300), ...(await serumCmn.createTokenAccountInstrs( program.provider, vault.publicKey, diff --git a/tests/cfo/tests/utils/stake.js b/tests/cfo/tests/utils/stake.js index d51b3172b1..0e927029c3 100644 --- a/tests/cfo/tests/utils/stake.js +++ b/tests/cfo/tests/utils/stake.js @@ -78,8 +78,8 @@ async function setupStakePool(mint, god) { }, signers: [registrar, rewardQ], instructions: [ - await registry.account.registrar.createInstruction(registrar), - await registry.account.rewardQueue.createInstruction(rewardQ, 8250), + await registry.account.registrar.createInstruction(registrar.publicKey), + await registry.account.rewardQueue.createInstruction(rewardQ.publicKey, 8250), ], } ); diff --git a/tests/composite/tests/composite.js b/tests/composite/tests/composite.js index 2a5e1eca55..c049873c73 100644 --- a/tests/composite/tests/composite.js +++ b/tests/composite/tests/composite.js @@ -21,8 +21,8 @@ describe("composite", () => { }, signers: [dummyA, dummyB], instructions: [ - await program.account.dummyA.createInstruction(dummyA), - await program.account.dummyB.createInstruction(dummyB), + await program.account.dummyA.createInstruction(dummyA.publicKey), + await program.account.dummyB.createInstruction(dummyB.publicKey), ], }); diff --git a/tests/custom-coder/tests/spl-associated-token-coder.ts b/tests/custom-coder/tests/spl-associated-token-coder.ts index e0b7a17619..7629be3818 100644 --- a/tests/custom-coder/tests/spl-associated-token-coder.ts +++ b/tests/custom-coder/tests/spl-associated-token-coder.ts @@ -44,7 +44,7 @@ describe("spl-associated-token-coder", () => { }) .preInstructions( await Promise.all([ - tokenProgram.account.mint.createInstruction(mintKeypair), + tokenProgram.account.mint.createInstruction(mintKeypair.publicKey), tokenProgram.methods .initializeMint(mintDecimals, provider.wallet.publicKey, null) .accounts({ diff --git a/tests/custom-coder/tests/spl-token-coder.ts b/tests/custom-coder/tests/spl-token-coder.ts index 566770ca04..fe8cf8975c 100644 --- a/tests/custom-coder/tests/spl-token-coder.ts +++ b/tests/custom-coder/tests/spl-token-coder.ts @@ -29,7 +29,7 @@ describe("spl-token", () => { }) .signers([mintKeypair]) .preInstructions([ - await program.account.mint.createInstruction(mintKeypair), + await program.account.mint.createInstruction(mintKeypair.publicKey), ]) .rpc(); const mintAccount = await program.account.mint.fetch(mintKeypair.publicKey); @@ -53,7 +53,7 @@ describe("spl-token", () => { }) .signers([aliceTokenKeypair]) .preInstructions([ - await program.account.account.createInstruction(aliceTokenKeypair), + await program.account.account.createInstruction(aliceTokenKeypair.publicKey), ]) .rpc(); const token = await program.account.account.fetch( @@ -98,7 +98,7 @@ describe("spl-token", () => { }) .signers([bobTokenKeypair]) .preInstructions([ - await program.account.account.createInstruction(bobTokenKeypair), + await program.account.account.createInstruction(bobTokenKeypair.publicKey), ]) .rpc(); }); diff --git a/tests/errors/tests/errors.ts b/tests/errors/tests/errors.ts index b7066d7d17..b300419cf7 100644 --- a/tests/errors/tests/errors.ts +++ b/tests/errors/tests/errors.ts @@ -203,7 +203,7 @@ describe("errors", () => { }, // this initializes the account.owner variable with Pubkey::default instructions: [ - await program.account.hasOneAccount.createInstruction(account), + await program.account.hasOneAccount.createInstruction(account.publicKey), ], signers: [account], }); diff --git a/tests/idl/tests/client-interactions.ts b/tests/idl/tests/client-interactions.ts index 25473fbec7..4e780df484 100644 --- a/tests/idl/tests/client-interactions.ts +++ b/tests/idl/tests/client-interactions.ts @@ -21,7 +21,7 @@ describe("Client interactions", () => { .int(i8, i16, i32, i64, i128) .accounts({ account: kp.publicKey }) .signers([kp]) - .preInstructions([await program.account.intAccount.createInstruction(kp)]) + .preInstructions([await program.account.intAccount.createInstruction(kp.publicKey)]) .rpc(); const account = await program.account.intAccount.fetch(kp.publicKey); @@ -46,7 +46,7 @@ describe("Client interactions", () => { .accounts({ account: kp.publicKey }) .signers([kp]) .preInstructions([ - await program.account.unsignedIntAccount.createInstruction(kp), + await program.account.unsignedIntAccount.createInstruction(kp.publicKey), ]) .rpc(); @@ -70,7 +70,7 @@ describe("Client interactions", () => { .accounts({ account: kp.publicKey }) .signers([kp]) .preInstructions([ - await program.account.enumAccount.createInstruction(kp), + await program.account.enumAccount.createInstruction(kp.publicKey), ]) .rpc(); return await program.account.enumAccount.fetch(kp.publicKey); @@ -135,7 +135,7 @@ describe("Client interactions", () => { .typeAlias(typeAliasU8, typeAliasU8Array, typeAliasStruct) .accounts({ account: kp.publicKey }) .signers([kp]) - .preInstructions([await program.account.intAccount.createInstruction(kp)]) + .preInstructions([await program.account.intAccount.createInstruction(kp.publicKey)]) .rpc(); const account = await program.account.typeAliasAccount.fetch(kp.publicKey); diff --git a/tests/idl/tests/idl-build-features.ts b/tests/idl/tests/idl-build-features.ts index 4abdb13d34..ed927397cc 100644 --- a/tests/idl/tests/idl-build-features.ts +++ b/tests/idl/tests/idl-build-features.ts @@ -18,7 +18,7 @@ describe("idl-build features", () => { .fullPath(outerMyStructArg, someModuleMyStructArg) .accounts({ account: kp.publicKey }) .preInstructions([ - await program.account.fullPathAccount.createInstruction(kp), + await program.account.fullPathAccount.createInstruction(kp.publicKey), ]) .signers([kp]) .rpc(); diff --git a/tests/lockup/migrations/deploy.js b/tests/lockup/migrations/deploy.js index bb0ed9646c..df5ff1b803 100644 --- a/tests/lockup/migrations/deploy.js +++ b/tests/lockup/migrations/deploy.js @@ -168,8 +168,8 @@ async function registrarInit( }, signers: [registrar, rewardQ], instructions: [ - await registry.account.registrar.createInstruction(registrar), - await registry.account.rewardQueue.createInstruction(rewardQ, 8250), + await registry.account.registrar.createInstruction(registrar.publicKey), + await registry.account.rewardQueue.createInstruction(rewardQ.publicKey, 8250), ], } ); diff --git a/tests/lockup/tests/lockup.js b/tests/lockup/tests/lockup.js index ace3104737..43be1f5e21 100644 --- a/tests/lockup/tests/lockup.js +++ b/tests/lockup/tests/lockup.js @@ -178,7 +178,7 @@ describe("Lockup and Registry", () => { }, signers: [vesting, vault], instructions: [ - await lockup.account.vesting.createInstruction(vesting), + await lockup.account.vesting.createInstruction(vesting.publicKey), ...(await serumCmn.createTokenAccountInstrs( provider, vault.publicKey, @@ -323,8 +323,8 @@ describe("Lockup and Registry", () => { }, signers: [registrar, rewardQ], instructions: [ - await registry.account.registrar.createInstruction(registrar), - await registry.account.rewardQueue.createInstruction(rewardQ, 8250), + await registry.account.registrar.createInstruction(registrar.publicKey), + await registry.account.rewardQueue.createInstruction(rewardQ.publicKey, 8250), ], } ); @@ -381,7 +381,7 @@ describe("Lockup and Registry", () => { tokenProgram: TOKEN_PROGRAM_ID, rent: anchor.web3.SYSVAR_RENT_PUBKEY, }, - instructions: [await registry.account.member.createInstruction(member)], + instructions: [await registry.account.member.createInstruction(member.publicKey)], }); const signers = [member, provider.wallet.payer]; @@ -515,7 +515,7 @@ describe("Lockup and Registry", () => { mint, unlockedVendorSigner )), - await registry.account.rewardVendor.createInstruction(unlockedVendor), + await registry.account.rewardVendor.createInstruction(unlockedVendor.publicKey), ], } ); @@ -634,7 +634,7 @@ describe("Lockup and Registry", () => { mint, lockedVendorSigner )), - await registry.account.rewardVendor.createInstruction(lockedVendor), + await registry.account.rewardVendor.createInstruction(lockedVendor.publicKey), ], } ); @@ -721,7 +721,7 @@ describe("Lockup and Registry", () => { remainingAccounts, signers: [vendoredVesting, vendoredVestingVault], instructions: [ - await lockup.account.vesting.createInstruction(vendoredVesting), + await lockup.account.vesting.createInstruction(vendoredVesting.publicKey), ...(await serumCmn.createTokenAccountInstrs( provider, vendoredVestingVault.publicKey, @@ -834,7 +834,7 @@ describe("Lockup and Registry", () => { signers: [pendingWithdrawal], instructions: [ await registry.account.pendingWithdrawal.createInstruction( - pendingWithdrawal + pendingWithdrawal.publicKey ), ], }); diff --git a/tests/misc/tests/misc/misc.ts b/tests/misc/tests/misc/misc.ts index 3567d928bb..23238dda94 100644 --- a/tests/misc/tests/misc/misc.ts +++ b/tests/misc/tests/misc/misc.ts @@ -48,7 +48,7 @@ const miscTest = ( .initialize(udata, idata) .accounts({ data: data.publicKey }) .signers([data]) - .preInstructions([await program.account.data.createInstruction(data)]) + .preInstructions([await program.account.data.createInstruction(data.publicKey)]) .rpc(); const dataAccount = await program.account.data.fetch(data.publicKey); assert(dataAccount.udata.eq(udata)); @@ -155,7 +155,7 @@ const miscTest = ( await program.methods .initialize(new anchor.BN(10), new anchor.BN(10)) .accounts({ data: data.publicKey }) - .preInstructions([await program.account.data.createInstruction(data)]) + .preInstructions([await program.account.data.createInstruction(data.publicKey)]) .signers([data]) .rpc(); @@ -205,7 +205,7 @@ const miscTest = ( await program.methods .initialize(new anchor.BN(10), new anchor.BN(10)) .accounts({ data: data.publicKey }) - .preInstructions([await program.account.data.createInstruction(data)]) + .preInstructions([await program.account.data.createInstruction(data.publicKey)]) .signers([data]) .rpc(); @@ -1342,7 +1342,7 @@ const miscTest = ( }, signers: [data], instructions: [ - await program.account.dataConstArraySize.createInstruction(data), + await program.account.dataConstArraySize.createInstruction(data.publicKey), ], }); const dataAccount = await program.account.dataConstArraySize.fetch( @@ -1360,7 +1360,7 @@ const miscTest = ( }, signers: [data], instructions: [ - await program.account.dataConstArraySize.createInstruction(data), + await program.account.dataConstArraySize.createInstruction(data.publicKey), ], }); const dataAccount = await program.account.dataConstArraySize.fetch( @@ -2420,7 +2420,7 @@ const miscTest = ( signers: [data], instructions: [ await program.account.dataMultidimensionalArray.createInstruction( - data + data.publicKey ), ], }); @@ -2440,7 +2440,7 @@ const miscTest = ( signers: [data], instructions: [ await program.account.dataMultidimensionalArrayConstSizes.createInstruction( - data + data.publicKey ), ], }); diff --git a/tests/multisig/tests/multisig.js b/tests/multisig/tests/multisig.js index f65e7d1822..6038fd84f1 100644 --- a/tests/multisig/tests/multisig.js +++ b/tests/multisig/tests/multisig.js @@ -30,7 +30,7 @@ describe("multisig", () => { }, instructions: [ await program.account.multisig.createInstruction( - multisig, + multisig.publicKey, multisigSize ), ], @@ -74,7 +74,7 @@ describe("multisig", () => { }, instructions: [ await program.account.transaction.createInstruction( - transaction, + transaction.publicKey, txSize ), ], diff --git a/tests/optional/tests/optional.ts b/tests/optional/tests/optional.ts index 19aeeb7f71..5819cb34fc 100644 --- a/tests/optional/tests/optional.ts +++ b/tests/optional/tests/optional.ts @@ -60,7 +60,7 @@ describe("Optional", () => { ): Promise<[web3.Keypair, web3.TransactionInstruction]> => { const keypair = requiredKeypair ?? new web3.Keypair(); const createIx = await program.account.dataAccount.createInstruction( - keypair + keypair.publicKey ); return [keypair, createIx]; }; diff --git a/tests/spl/token-proxy/tests/token-proxy.js b/tests/spl/token-proxy/tests/token-proxy.js index c7f4e0fed4..95230b1240 100644 --- a/tests/spl/token-proxy/tests/token-proxy.js +++ b/tests/spl/token-proxy/tests/token-proxy.js @@ -266,7 +266,7 @@ async function getMintInfo(provider, mintAddr) { async function createMint(tokenProgram) { const mint = anchor.web3.Keypair.generate(); const authority = tokenProgram.provider.wallet.publicKey; - const createMintIx = await tokenProgram.account.mint.createInstruction(mint); + const createMintIx = await tokenProgram.account.mint.createInstruction(mint.publicKey); const initMintIx = await tokenProgram.methods .initializeMint2(0, authority, null) .accounts({ mint: mint.publicKey }) @@ -284,7 +284,7 @@ async function createTokenAccount(tokenProgram, mint, owner) { const vault = anchor.web3.Keypair.generate(); const tx = new anchor.web3.Transaction(); const createTokenAccountIx = - await tokenProgram.account.account.createInstruction(vault); + await tokenProgram.account.account.createInstruction(vault.publicKey); const initTokenAccountIx = await tokenProgram.methods .initializeAccount3(owner) .accounts({ account: vault.publicKey, mint }) diff --git a/tests/tictactoe/tests/tictactoe.js b/tests/tictactoe/tests/tictactoe.js index c405166ede..bb8ccb3815 100644 --- a/tests/tictactoe/tests/tictactoe.js +++ b/tests/tictactoe/tests/tictactoe.js @@ -16,7 +16,7 @@ describe("tictactoe", () => { }, signers: [dashboard], instructions: [ - await program.account.dashboard.createInstruction(dashboard), + await program.account.dashboard.createInstruction(dashboard.publicKey), ], }); @@ -32,7 +32,7 @@ describe("tictactoe", () => { rent: anchor.web3.SYSVAR_RENT_PUBKEY, }, signers: [game], - instructions: [await program.account.game.createInstruction(game)], + instructions: [await program.account.game.createInstruction(game.publicKey)], }); console.log("transaction: ", tx); diff --git a/tests/zero-copy/tests/zero-copy.js b/tests/zero-copy/tests/zero-copy.js index 805cd8c467..e559325d98 100644 --- a/tests/zero-copy/tests/zero-copy.js +++ b/tests/zero-copy/tests/zero-copy.js @@ -19,7 +19,7 @@ describe("zero-copy", () => { authority: program.provider.wallet.publicKey, rent: anchor.web3.SYSVAR_RENT_PUBKEY, }, - instructions: [await program.account.foo.createInstruction(foo)], + instructions: [await program.account.foo.createInstruction(foo.publicKey)], signers: [foo], }); const account = await program.account.foo.fetch(foo.publicKey); @@ -161,7 +161,7 @@ describe("zero-copy", () => { rent: anchor.web3.SYSVAR_RENT_PUBKEY, }, instructions: [ - await program.account.eventQ.createInstruction(eventQ, size), + await program.account.eventQ.createInstruction(eventQ.publicKey, size), ], signers: [eventQ], }); diff --git a/ts/tests/src/spl/binary-oracle-pair.ts b/ts/tests/src/spl/binary-oracle-pair.ts index 12abf4b9a8..6a9a70e04c 100644 --- a/ts/tests/src/spl/binary-oracle-pair.ts +++ b/ts/tests/src/spl/binary-oracle-pair.ts @@ -54,7 +54,7 @@ export async function binaryOraclePairTests() { const poolKp = new Keypair(); poolPk = poolKp.publicKey; const createPoolAccountIx = await program.account.pool.createInstruction( - poolKp + poolPk ); // Accounts that are expected to be initialized poolDepositMintPk = await createMint(); @@ -64,18 +64,18 @@ export async function binaryOraclePairTests() { poolDepositTokenAccountPk = depositTokenAccountKp.publicKey; const createDepositTokenAccountIx = await tokenProgram.account.account.createInstruction( - depositTokenAccountKp + poolDepositTokenAccountPk ); const tokenPassMintKp = new Keypair(); tokenPassMintPk = tokenPassMintKp.publicKey; const createTokenPassMintIx = - await tokenProgram.account.mint.createInstruction(tokenPassMintKp); + await tokenProgram.account.mint.createInstruction(tokenPassMintPk); const tokenFailMintKp = new Keypair(); tokenFailMintPk = tokenFailMintKp.publicKey; const createTokenFailMintIx = - await tokenProgram.account.mint.createInstruction(tokenFailMintKp); + await tokenProgram.account.mint.createInstruction(tokenFailMintPk); const [authorityPk, bump] = await PublicKey.findProgramAddress( [poolPk.toBuffer()], diff --git a/ts/tests/src/spl/record.ts b/ts/tests/src/spl/record.ts index c8134740bc..c499a02ff8 100644 --- a/ts/tests/src/spl/record.ts +++ b/ts/tests/src/spl/record.ts @@ -28,7 +28,7 @@ export async function recordTests() { const recordKp = new Keypair(); recordPk = recordKp.publicKey; const createRecordAccountIx = - await program.account.recordData.createInstruction(recordKp); + await program.account.recordData.createInstruction(recordPk); const initIx = await program.methods .initialize() .accounts({ diff --git a/ts/tests/src/spl/stake-pool.ts b/ts/tests/src/spl/stake-pool.ts index 8eb99cb410..dd0b3ce035 100644 --- a/ts/tests/src/spl/stake-pool.ts +++ b/ts/tests/src/spl/stake-pool.ts @@ -57,7 +57,7 @@ export async function stakePoolTests() { const stakePoolKp = new Keypair(); stakePoolPk = stakePoolKp.publicKey; const createStakePoolAccountIx = - await program.account.stakePool.createInstruction(stakePoolKp, 5000); + await program.account.stakePool.createInstruction(stakePoolPk, 5000); [withdrawAuthorityPk] = await PublicKey.findProgramAddress( [stakePoolPk.toBuffer(), Buffer.from("withdraw")], @@ -74,7 +74,7 @@ export async function stakePoolTests() { validatorListPk = validatorListKp.publicKey; const createValidatorListAccountIx = await program.account.validatorList.createInstruction( - validatorListKp, + validatorListPk, 5 + 4 + 73 * VALIDATOR_LIST_COUNT ); diff --git a/ts/tests/src/spl/token-lending.ts b/ts/tests/src/spl/token-lending.ts index b891296e0a..bf6bc0dd50 100644 --- a/ts/tests/src/spl/token-lending.ts +++ b/ts/tests/src/spl/token-lending.ts @@ -66,9 +66,9 @@ export async function tokenLendingTests() { const quoteCurrency = NATIVE_MINT_PK; const lendingMarketKp = new Keypair(); - // lendingMarketPk = lendingMarketKp.publicKey; + lendingMarketPk = lendingMarketKp.publicKey; const createLendingMarketAccountIx = - await program.account.lendingMarket.createInstruction(lendingMarketKp); + await program.account.lendingMarket.createInstruction(lendingMarketPk); const initLendingMarketIx = await program.methods .initLendingMarket( @@ -105,20 +105,20 @@ export async function tokenLendingTests() { const reserveKp = new Keypair(); reservePk = reserveKp.publicKey; const createReserveAccountIx = - await program.account.reserve.createInstruction(reserveKp); + await program.account.reserve.createInstruction(reservePk); // Create colleteral mint account const colleteralMintKp = new Keypair(); colleteralMintPk = colleteralMintKp.publicKey; const createColleteralMintIx = - await tokenProgram.account.mint.createInstruction(colleteralMintKp); + await tokenProgram.account.mint.createInstruction(colleteralMintPk); // Create colleteral supply account const colleteralSupplyAccountKp = new Keypair(); colleteralSupplyAccountPk = colleteralSupplyAccountKp.publicKey; const createColleteralSupplyAccountIx = await tokenProgram.account.account.createInstruction( - colleteralSupplyAccountKp + colleteralSupplyAccountPk ); // Create user colleteral account @@ -126,7 +126,7 @@ export async function tokenLendingTests() { userColleteralAccountPk = userColleteralAccountKp.publicKey; const createUserColleteralAccountIx = await tokenProgram.account.account.createInstruction( - userColleteralAccountKp + userColleteralAccountPk ); // Create liquidity supply account @@ -134,7 +134,7 @@ export async function tokenLendingTests() { liquiditySupplyAccountPk = liquiditySupplyAccountKp.publicKey; const createLiquiditySupplyAccountIx = await tokenProgram.account.account.createInstruction( - liquiditySupplyAccountKp + liquiditySupplyAccountPk ); // Create liquidity fee receiver account @@ -142,7 +142,7 @@ export async function tokenLendingTests() { liquidityFeeReceiverAccountPk = liquitidyFeeReceiverAccountKp.publicKey; const createLiquidityFeeReceiverAccountIx = await tokenProgram.account.account.createInstruction( - liquitidyFeeReceiverAccountKp + liquidityFeeReceiverAccountPk ); // Send setup transaction diff --git a/ts/tests/src/spl/token-swap.ts b/ts/tests/src/spl/token-swap.ts index 713fbeb01a..453b7eb378 100644 --- a/ts/tests/src/spl/token-swap.ts +++ b/ts/tests/src/spl/token-swap.ts @@ -68,7 +68,7 @@ export async function tokenSwapTests() { const poolMintKp = new Keypair(); poolMintPk = poolMintKp.publicKey; const createPoolMintAccountIx = - await tokenProgram.account.mint.createInstruction(poolMintKp); + await tokenProgram.account.mint.createInstruction(poolMintPk); const initPoolMintAccountIx = await tokenProgram.methods .initializeMint(2, swapAuthorityPk, null) .accounts({ @@ -80,7 +80,7 @@ export async function tokenSwapTests() { const poolTokenAccountKp = new Keypair(); poolTokenAccountPk = poolTokenAccountKp.publicKey; const createPoolTokenAccountIx = - await tokenProgram.account.account.createInstruction(poolTokenAccountKp); + await tokenProgram.account.account.createInstruction(poolTokenAccountPk); const initPoolTokenAccountIx = await tokenProgram.methods .initializeAccount() .accounts({ @@ -94,7 +94,7 @@ export async function tokenSwapTests() { const feeAccountKp = new Keypair(); feeAccountPk = feeAccountKp.publicKey; const createFeeTokenAccountIx = - await tokenProgram.account.account.createInstruction(feeAccountKp); + await tokenProgram.account.account.createInstruction(feeAccountPk); const initFeeTokenAccountIx = await tokenProgram.methods .initializeAccount() .accounts({ @@ -108,7 +108,7 @@ export async function tokenSwapTests() { const mintAKp = new Keypair(); mintAPk = mintAKp.publicKey; const createMintAIx = await tokenProgram.account.mint.createInstruction( - mintAKp + mintAPk ); const initMintAIx = await tokenProgram.methods .initializeMint(2, kp.publicKey, null) @@ -118,7 +118,7 @@ export async function tokenSwapTests() { const tokenAccountA = new Keypair(); tokenAccountAPk = tokenAccountA.publicKey; const createTokenAccountAIx = - await tokenProgram.account.account.createInstruction(tokenAccountA); + await tokenProgram.account.account.createInstruction(tokenAccountAPk); const initTokenAccountAIx = await tokenProgram.methods .initializeAccount() .accounts({ @@ -140,7 +140,7 @@ export async function tokenSwapTests() { const mintBKp = new Keypair(); mintBPk = mintBKp.publicKey; const createMintBIx = await tokenProgram.account.mint.createInstruction( - mintBKp + mintBPk ); const initMintBIx = await tokenProgram.methods .initializeMint(2, kp.publicKey, null) @@ -150,7 +150,7 @@ export async function tokenSwapTests() { const tokenAccountB = new Keypair(); tokenAccountBPk = tokenAccountB.publicKey; const createTokenAccountBIx = - await tokenProgram.account.account.createInstruction(tokenAccountB); + await tokenProgram.account.account.createInstruction(tokenAccountBPk); const initTokenAccountBIx = await tokenProgram.methods .initializeAccount() .accounts({ @@ -171,7 +171,7 @@ export async function tokenSwapTests() { .instruction(); const createTokenSwapAccountIx = - await program.account.swap.createInstruction(swapKp); + await program.account.swap.createInstruction(swapPk); const calculator = new Uint8Array(32).fill(0); // calculator[0] = 8; const initTokenSwapIx = await program.methods diff --git a/ts/tests/src/spl/token.ts b/ts/tests/src/spl/token.ts index 8156eeb8a1..b6d40825c1 100644 --- a/ts/tests/src/spl/token.ts +++ b/ts/tests/src/spl/token.ts @@ -31,7 +31,7 @@ export async function splTokenTests() { const mintKp = new Keypair(); mintPk = mintKp.publicKey; const createMintAccountIx = await program.account.mint.createInstruction( - mintKp + mintPk ); const initMintIx = await program.methods .initializeMint(DECIMALS, kp.publicKey, kp.publicKey) @@ -48,7 +48,7 @@ export async function splTokenTests() { const accountKp = new Keypair(); tokenAccountPk = accountKp.publicKey; const createTokenAccountIx = - await program.account.account.createInstruction(accountKp); + await program.account.account.createInstruction(tokenAccountPk); const initAccountIx = await program.methods .initializeAccount() .accounts({ @@ -70,7 +70,7 @@ export async function splTokenTests() { multisigPk = multisigKp.publicKey; const multisig1 = new Keypair(); const createTokenAccountIx = - await program.account.multisig.createInstruction(multisigKp); + await program.account.multisig.createInstruction(multisigPk); const initAccountIx = await program.methods .initializeMultisig(MULTISIG_COUNT) .accounts({ @@ -237,7 +237,7 @@ export async function splTokenTests() { const mintKp = new Keypair(); mintPk = mintKp.publicKey; const createMintAccountIx = await program.account.mint.createInstruction( - mintKp + mintPk ); const initMintIx = await program.methods .initializeMint2(DECIMALS, kp.publicKey, kp.publicKey) @@ -253,7 +253,7 @@ export async function splTokenTests() { const accountKp = new Keypair(); tokenAccountPk = accountKp.publicKey; const createTokenAccountIx = - await program.account.account.createInstruction(accountKp); + await program.account.account.createInstruction(tokenAccountPk); const initAccountIx = await program.methods .initializeAccount2(kp.publicKey) .accounts({ @@ -273,7 +273,7 @@ export async function splTokenTests() { const accountKp = new Keypair(); tokenAccountPk = accountKp.publicKey; const createTokenAccountIx = - await program.account.account.createInstruction(accountKp); + await program.account.account.createInstruction(tokenAccountPk); const initAccountIx = await program.methods .initializeAccount3(kp.publicKey) .accounts({ @@ -292,7 +292,7 @@ export async function splTokenTests() { const multisigKp = new Keypair(); const multisig1 = new Keypair(); const createTokenAccountIx = - await program.account.multisig.createInstruction(multisigKp); + await program.account.multisig.createInstruction(multisigKp.publicKey); const initAccountIx = await program.methods .initializeMultisig2(2) .accounts({ @@ -333,7 +333,7 @@ export async function splTokenTests() { async function initializeImmutableOwner() { const accountKp = new Keypair(); const createAccountIx = await program.account.account.createInstruction( - accountKp + accountKp.publicKey ); const initImmutableOwnerIx = await program.methods .initializeImmutableOwner() diff --git a/ts/tests/src/utils.ts b/ts/tests/src/utils.ts index 3ce45afced..08c6679f60 100644 --- a/ts/tests/src/utils.ts +++ b/ts/tests/src/utils.ts @@ -178,7 +178,7 @@ export async function createMint(ownerPk?: PublicKey) { }); const mintKp = new Keypair(); const createMintAccountIx = await tokenProgram.account.mint.createInstruction( - mintKp + mintKp.publicKey ); const initMintIx = await tokenProgram.methods .initializeMint(6, ownerPk, null) @@ -206,7 +206,7 @@ export async function createTokenAccount( const accountKp = new Keypair(); const createTokenAccountIx = - await tokenProgram.account.account.createInstruction(accountKp); + await tokenProgram.account.account.createInstruction(accountKp.publicKey); const initAccountIx = await tokenProgram.methods .initializeAccount() .accounts({