* Add StakeInstruction::AuthorizeWithSeed
* chore: add authorize-with-seed to web.js
* fix: add address_owner
* Add SystemInstruction::TransferWithSeed
* Update ABI hash
* chore: better variable names
* Add AuthorizeWithSeedArgs
* Reorder and rename arguments for clarity
(cherry picked from commit f02a78d8ff
)
Co-authored-by: Greg Fitzgerald <greg@solana.com>
This commit is contained in:
@@ -128,6 +128,27 @@ test('authorize', () => {
|
||||
expect(params).toEqual(StakeInstruction.decodeAuthorize(stakeInstruction));
|
||||
});
|
||||
|
||||
test('authorizeWithSeed', () => {
|
||||
const stakePubkey = new Account().publicKey;
|
||||
const authorityBase = new Account().publicKey;
|
||||
const authoritySeed = 'test string';
|
||||
const authorityOwner = new Account().publicKey;
|
||||
const newAuthorizedPubkey = new Account().publicKey;
|
||||
const stakeAuthorizationType = StakeAuthorizationLayout.Staker;
|
||||
const params = {
|
||||
stakePubkey,
|
||||
authorityBase,
|
||||
authoritySeed,
|
||||
authorityOwner,
|
||||
newAuthorizedPubkey,
|
||||
stakeAuthorizationType,
|
||||
};
|
||||
const transaction = StakeProgram.authorizeWithSeed(params);
|
||||
expect(transaction.instructions).toHaveLength(1);
|
||||
const [stakeInstruction] = transaction.instructions;
|
||||
expect(params).toEqual(StakeInstruction.decodeAuthorizeWithSeed(stakeInstruction));
|
||||
});
|
||||
|
||||
test('split', () => {
|
||||
const stakePubkey = new Account().publicKey;
|
||||
const authorizedPubkey = new Account().publicKey;
|
||||
|
Reference in New Issue
Block a user