Include Clock sysvar in AuthorizeWithSeed instruction
This commit is contained in:
parent
2b50433099
commit
8359f4f5ff
|
@ -66,7 +66,7 @@ pub enum StakeInstruction {
|
||||||
///
|
///
|
||||||
/// # Account references
|
/// # Account references
|
||||||
/// 0. [WRITE] Stake account to be updated
|
/// 0. [WRITE] Stake account to be updated
|
||||||
/// 1. [] (reserved for future use) Clock sysvar
|
/// 1. [] Clock sysvar
|
||||||
/// 2. [SIGNER] The stake or withdraw authority
|
/// 2. [SIGNER] The stake or withdraw authority
|
||||||
Authorize(Pubkey, StakeAuthorize),
|
Authorize(Pubkey, StakeAuthorize),
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ pub enum StakeInstruction {
|
||||||
/// # Account references
|
/// # Account references
|
||||||
/// 0. [WRITE] Stake account to be updated
|
/// 0. [WRITE] Stake account to be updated
|
||||||
/// 1. [SIGNER] Base key of stake or withdraw authority
|
/// 1. [SIGNER] Base key of stake or withdraw authority
|
||||||
|
/// 2. [] Clock sysvar
|
||||||
AuthorizeWithSeed(AuthorizeWithSeedArgs),
|
AuthorizeWithSeed(AuthorizeWithSeedArgs),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,6 +369,7 @@ pub fn authorize_with_seed(
|
||||||
let account_metas = vec![
|
let account_metas = vec![
|
||||||
AccountMeta::new(*stake_pubkey, false),
|
AccountMeta::new(*stake_pubkey, false),
|
||||||
AccountMeta::new_readonly(*authority_base, true),
|
AccountMeta::new_readonly(*authority_base, true),
|
||||||
|
AccountMeta::new_readonly(sysvar::clock::id(), false),
|
||||||
];
|
];
|
||||||
|
|
||||||
let args = AuthorizeWithSeedArgs {
|
let args = AuthorizeWithSeedArgs {
|
||||||
|
|
|
@ -354,7 +354,7 @@ mod test {
|
||||||
);
|
);
|
||||||
let message = Message::new(&[instruction], None);
|
let message = Message::new(&[instruction], None);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_stake(&message.instructions[0], &keys[0..2]).unwrap(),
|
parse_stake(&message.instructions[0], &keys[0..3]).unwrap(),
|
||||||
ParsedInstructionEnum {
|
ParsedInstructionEnum {
|
||||||
instruction_type: "authorizeWithSeed".to_string(),
|
instruction_type: "authorizeWithSeed".to_string(),
|
||||||
info: json!({
|
info: json!({
|
||||||
|
|
Loading…
Reference in New Issue