diff --git a/web3.js/src/stake-program.js b/web3.js/src/stake-program.js index 6c0468dd12..76326d8dd0 100644 --- a/web3.js/src/stake-program.js +++ b/web3.js/src/stake-program.js @@ -243,6 +243,7 @@ export class StakeProgram { static createAccountWithSeed( from: PublicKey, stakeAccount: PublicKey, + base: PublicKey, seed: string, authorized: Authorized, lockup: Lockup, @@ -251,6 +252,7 @@ export class StakeProgram { let transaction = SystemProgram.createAccountWithSeed( from, stakeAccount, + base, seed, lamports, this.space, diff --git a/web3.js/test/stake-program.test.js b/web3.js/test/stake-program.test.js index c0f9d149f2..1eea61a0ae 100644 --- a/web3.js/test/stake-program.test.js +++ b/web3.js/test/stake-program.test.js @@ -38,6 +38,7 @@ test('createAccountWithSeed', () => { transaction = StakeProgram.createAccountWithSeed( from.publicKey, newAccountPubkey, + from.publicKey, seed, new Authorized(authorized.publicKey, authorized.publicKey), new Lockup(0, 0, from.publicKey), @@ -187,6 +188,7 @@ test('StakeInstructions', () => { const createWithSeed = StakeProgram.createAccountWithSeed( from.publicKey, newAccountPubkey, + from.publicKey, seed, new Authorized(authorized.publicKey, authorized.publicKey), new Lockup(0, 0, from.publicKey), @@ -244,8 +246,8 @@ test('live staking actions', async () => { const from = new Account(); const authorized = new Account(); - await connection.requestAirdrop(from.publicKey, LAMPORTS_PER_SOL); - await connection.requestAirdrop(authorized.publicKey, LAMPORTS_PER_SOL); + await connection.requestAirdrop(from.publicKey, 2 * LAMPORTS_PER_SOL); + await connection.requestAirdrop(authorized.publicKey, 2 * LAMPORTS_PER_SOL); const minimumAmount = await connection.getMinimumBalanceForRentExemption( StakeProgram.space, @@ -263,6 +265,7 @@ test('live staking actions', async () => { let createAndInitializeWithSeed = StakeProgram.createAccountWithSeed( from.publicKey, newAccountPubkey, + from.publicKey, seed, new Authorized(authorized.publicKey, authorized.publicKey), new Lockup(0, 0, new PublicKey('0x00')),