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

@ -34,7 +34,12 @@ impl BudgetTransaction {
/// Create and sign a new Transaction. Used for unit-testing.
#[allow(clippy::new_ret_no_self)]
pub fn new(from_keypair: &Keypair, to: Pubkey, tokens: u64, recent_block_hash: Hash) -> Transaction {
pub fn new(
from_keypair: &Keypair,
to: Pubkey,
tokens: u64,
recent_block_hash: Hash,
) -> Transaction {
Self::new_payment(from_keypair, to, tokens, recent_block_hash, 0)
}

View File

@ -18,7 +18,14 @@ impl LoaderTransaction {
fee: u64,
) -> Transaction {
let instruction = LoaderInstruction::Write { offset, bytes };
Transaction::new(from_keypair, &[], loader, &instruction, recent_block_hash, fee)
Transaction::new(
from_keypair,
&[],
loader,
&instruction,
recent_block_hash,
fee,
)
}
pub fn new_finalize(
@ -28,6 +35,13 @@ impl LoaderTransaction {
fee: u64,
) -> Transaction {
let instruction = LoaderInstruction::Finalize;
Transaction::new(from_keypair, &[], loader, &instruction, recent_block_hash, fee)
Transaction::new(
from_keypair,
&[],
loader,
&instruction,
recent_block_hash,
fee,
)
}
}

View File

@ -44,7 +44,15 @@ impl SystemTransaction {
fee: u64,
) -> Transaction {
let program_id = system_program::id();
Self::new_program_account(from_keypair, to, recent_block_hash, tokens, 0, program_id, fee)
Self::new_program_account(
from_keypair,
to,
recent_block_hash,
tokens,
0,
program_id,
fee,
)
}
/// Create and sign new SystemInstruction::Assign transaction
pub fn new_assign(

View File

@ -332,7 +332,8 @@ impl Serialize for Transaction {
.map_err(Error::custom)?;
serialize_vec_with(&mut wr, &self.account_keys, Transaction::serialize_pubkey)
.map_err(Error::custom)?;
wr.write_all(self.recent_block_hash.as_ref()).map_err(Error::custom)?;
wr.write_all(self.recent_block_hash.as_ref())
.map_err(Error::custom)?;
wr.write_u64::<LittleEndian>(self.fee)
.map_err(Error::custom)?;
serialize_vec_with(&mut wr, &self.program_ids, Transaction::serialize_pubkey)