cargo fmt

This commit is contained in:
Michael Vines
2019-03-02 10:20:10 -08:00
committed by Greg Fitzgerald
parent 85159a0eb4
commit 0f1582c196
17 changed files with 195 additions and 52 deletions

View File

@ -36,7 +36,8 @@ impl<'a> RewardsBank<'a> {
lamports: u64,
) -> Result<()> {
let block_hash = self.bank.last_block_hash();
let tx = VoteTransaction::fund_staking_account(from_keypair, vote_id, block_hash, lamports, 0);
let tx =
VoteTransaction::fund_staking_account(from_keypair, vote_id, block_hash, lamports, 0);
self.bank.process_transaction(&tx)
}

View File

@ -52,10 +52,12 @@ fn test_bank_storage() {
bank.register_tick(&block_hash);
bank.transfer(10, &alice, jill.pubkey(), block_hash).unwrap();
bank.transfer(10, &alice, jill.pubkey(), block_hash)
.unwrap();
bank.transfer(10, &alice, bob.pubkey(), block_hash).unwrap();
bank.transfer(10, &alice, jack.pubkey(), block_hash).unwrap();
bank.transfer(10, &alice, jack.pubkey(), block_hash)
.unwrap();
let tx = SystemTransaction::new_program_account(
&alice,
@ -94,5 +96,8 @@ fn test_bank_storage() {
get_storage_entry_height(&bank, bob.pubkey()),
ENTRIES_PER_SEGMENT
);
assert_eq!(get_storage_block_hash(&bank, bob.pubkey()), storage_block_hash);
assert_eq!(
get_storage_block_hash(&bank, bob.pubkey()),
storage_block_hash
);
}

View File

@ -27,7 +27,8 @@ impl<'a> VoteBank<'a> {
lamports: u64,
) -> Result<()> {
let block_hash = self.bank.last_block_hash();
let tx = VoteTransaction::fund_staking_account(from_keypair, vote_id, block_hash, lamports, 0);
let tx =
VoteTransaction::fund_staking_account(from_keypair, vote_id, block_hash, lamports, 0);
self.bank.process_transaction(&tx)
}

View File

@ -39,7 +39,8 @@ fn load_program(bank: &Bank, from: &Keypair, loader_id: Pubkey, program: Vec<u8>
offset += chunk_size as u32;
}
let tx = LoaderTransaction::new_finalize(&program_account, loader_id, bank.last_block_hash(), 0);
let tx =
LoaderTransaction::new_finalize(&program_account, loader_id, bank.last_block_hash(), 0);
bank.process_transaction(&tx).unwrap();
assert_eq!(bank.get_signature_status(&tx.signatures[0]), Some(Ok(())));
@ -57,7 +58,14 @@ fn test_program_native_noop() {
let program_id = load_program(&bank, &mint_keypair, native_loader::id(), program);
// Call user program
let tx = Transaction::new(&mint_keypair, &[], program_id, &1u8, bank.last_block_hash(), 0);
let tx = Transaction::new(
&mint_keypair,
&[],
program_id,
&1u8,
bank.last_block_hash(),
0,
);
bank.process_transaction(&tx).unwrap();
assert_eq!(bank.get_signature_status(&tx.signatures[0]), Some(Ok(())));
}
@ -73,7 +81,14 @@ fn test_program_native_failure() {
let program_id = load_program(&bank, &mint_keypair, native_loader::id(), program);
// Call user program
let tx = Transaction::new(&mint_keypair, &[], program_id, &1u8, bank.last_block_hash(), 0);
let tx = Transaction::new(
&mint_keypair,
&[],
program_id,
&1u8,
bank.last_block_hash(),
0,
);
assert_eq!(
bank.process_transaction(&tx),
Err(BankError::ProgramError(0, ProgramError::GenericError))