cargo fmt
This commit is contained in:
committed by
Greg Fitzgerald
parent
85159a0eb4
commit
0f1582c196
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user