Remove WithSigner (#10325)

automerge
This commit is contained in:
Greg Fitzgerald
2020-05-30 00:17:44 -06:00
committed by GitHub
parent 55a64712b9
commit 19d11800bf
7 changed files with 103 additions and 99 deletions

View File

@@ -12,7 +12,7 @@ use solana_metrics::inc_new_counter_info;
use solana_sdk::{
account::{get_signers, KeyedAccount},
hash::Hash,
instruction::{AccountMeta, Instruction, InstructionError, WithSigner},
instruction::{AccountMeta, Instruction, InstructionError},
program_utils::{limited_deserialize, next_keyed_account, DecodeError},
pubkey::Pubkey,
system_instruction,
@@ -108,8 +108,8 @@ fn initialize_account(vote_pubkey: &Pubkey, vote_init: &VoteInit) -> Instruction
AccountMeta::new(*vote_pubkey, false),
AccountMeta::new_readonly(sysvar::rent::id(), false),
AccountMeta::new_readonly(sysvar::clock::id(), false),
]
.with_signer(&vote_init.node_pubkey);
AccountMeta::new_readonly(vote_init.node_pubkey, true),
];
Instruction::new(
id(),
@@ -162,8 +162,8 @@ pub fn authorize(
let account_metas = vec![
AccountMeta::new(*vote_pubkey, false),
AccountMeta::new_readonly(sysvar::clock::id(), false),
]
.with_signer(authorized_pubkey);
AccountMeta::new_readonly(*authorized_pubkey, true),
];
Instruction::new(
id(),
@@ -180,8 +180,8 @@ pub fn update_validator_identity(
let account_metas = vec![
AccountMeta::new(*vote_pubkey, false),
AccountMeta::new_readonly(*node_pubkey, true),
]
.with_signer(authorized_withdrawer_pubkey);
AccountMeta::new_readonly(*authorized_withdrawer_pubkey, true),
];
Instruction::new(
id(),
@@ -195,8 +195,8 @@ pub fn vote(vote_pubkey: &Pubkey, authorized_voter_pubkey: &Pubkey, vote: Vote)
AccountMeta::new(*vote_pubkey, false),
AccountMeta::new_readonly(sysvar::slot_hashes::id(), false),
AccountMeta::new_readonly(sysvar::clock::id(), false),
]
.with_signer(authorized_voter_pubkey);
AccountMeta::new_readonly(*authorized_voter_pubkey, true),
];
Instruction::new(id(), &VoteInstruction::Vote(vote), account_metas)
}
@@ -211,8 +211,8 @@ pub fn vote_switch(
AccountMeta::new(*vote_pubkey, false),
AccountMeta::new_readonly(sysvar::slot_hashes::id(), false),
AccountMeta::new_readonly(sysvar::clock::id(), false),
]
.with_signer(authorized_voter_pubkey);
AccountMeta::new_readonly(*authorized_voter_pubkey, true),
];
Instruction::new(
id(),
@@ -230,8 +230,8 @@ pub fn withdraw(
let account_metas = vec![
AccountMeta::new(*vote_pubkey, false),
AccountMeta::new(*to_pubkey, false),
]
.with_signer(authorized_withdrawer_pubkey);
AccountMeta::new_readonly(*authorized_withdrawer_pubkey, true),
];
Instruction::new(id(), &VoteInstruction::Withdraw(lamports), account_metas)
}