Remove blockhash parameter from Bank::transfer

That parameter is an artifact from the Loom days, when I thought
Bank should implement the same interace as ThinClient.
This commit is contained in:
Greg Fitzgerald
2019-03-27 05:59:30 -06:00
parent 0ac865f08c
commit cecdb7061e
5 changed files with 21 additions and 47 deletions

View File

@ -568,14 +568,8 @@ mod tests {
let keypair3 = Keypair::new();
// fund: put 4 in each of 1 and 2
assert_matches!(
bank.transfer(4, &mint_keypair, &keypair1.pubkey(), bank.last_blockhash()),
Ok(_)
);
assert_matches!(
bank.transfer(4, &mint_keypair, &keypair2.pubkey(), bank.last_blockhash()),
Ok(_)
);
assert_matches!(bank.transfer(4, &mint_keypair, &keypair1.pubkey()), Ok(_));
assert_matches!(bank.transfer(4, &mint_keypair, &keypair2.pubkey()), Ok(_));
// construct an Entry whose 2nd transaction would cause a lock conflict with previous entry
let entry_1_to_mint = next_entry(

View File

@ -144,8 +144,6 @@ mod tests {
bank = Arc::new(Bank::new_from_parent(&bank, &Pubkey::default(), slot));
}
let blockhash = bank.last_blockhash();
// Create a total of 10 vote accounts, each will have a balance of 1 (after giving 1 to
// their vote account), for a total staking pool of 10 lamports.
let vote_accounts: Vec<_> = (0..10)
@ -156,7 +154,7 @@ mod tests {
let voting_pubkey = voting_keypair.pubkey();
// Give the validator some lamports
bank.transfer(2, &mint_keypair, &validator_keypair.pubkey(), blockhash)
bank.transfer(2, &mint_keypair, &validator_keypair.pubkey())
.unwrap();
new_vote_account(&validator_keypair, &voting_pubkey, &bank, 1);
@ -177,6 +175,7 @@ mod tests {
assert_eq!(last_confirmation_time, 0);
// Get another validator to vote, so we now have 2/3 consensus
let blockhash = bank.last_blockhash();
let voting_keypair = &vote_accounts[7].0;
let vote = Vote::new(MAX_RECENT_BLOCKHASHES as u64);
let vote_ix = VoteInstruction::new_vote(&voting_keypair.pubkey(), vote);

View File

@ -193,7 +193,7 @@ mod tests {
// Give the validator some stake but don't setup a staking account
// Validator has no lamports staked, so they get filtered out. Only the bootstrap leader
// created by the genesis block will get included
bank.transfer(1, &mint_keypair, &validator.pubkey(), genesis_block.hash())
bank.transfer(1, &mint_keypair, &validator.pubkey())
.unwrap();
// Make a mint vote account. Because the mint has nonzero stake, this