fix: align web3 stake split instruction constuction with rust
This commit is contained in:
committed by
Trent Nelson
parent
a8b1d71ae6
commit
19813b0ab2
@ -558,13 +558,12 @@ export class StakeProgram {
|
||||
const {stakePubkey, authorizedPubkey, splitStakePubkey, lamports} = params;
|
||||
|
||||
let transaction = SystemProgram.createAccount({
|
||||
fromPubkey: stakePubkey,
|
||||
fromPubkey: authorizedPubkey,
|
||||
newAccountPubkey: splitStakePubkey,
|
||||
lamports: 0,
|
||||
space: this.space,
|
||||
programId: this.programId,
|
||||
});
|
||||
transaction.instructions[0].keys[0].isSigner = false;
|
||||
const type = STAKE_INSTRUCTION_LAYOUTS.Split;
|
||||
const data = encodeData(type, {lamports});
|
||||
|
||||
|
@ -142,7 +142,7 @@ test('split', () => {
|
||||
expect(transaction.instructions).toHaveLength(2);
|
||||
const [systemInstruction, stakeInstruction] = transaction.instructions;
|
||||
const systemParams = {
|
||||
fromPubkey: stakePubkey,
|
||||
fromPubkey: authorizedPubkey,
|
||||
newAccountPubkey: splitStakePubkey,
|
||||
lamports: 0,
|
||||
space: StakeProgram.space,
|
||||
|
Reference in New Issue
Block a user