Rename Transaction last_id field to recent_block_hash

This commit is contained in:
Michael Vines
2019-03-02 09:17:03 -08:00
committed by Greg Fitzgerald
parent 16b71a6be0
commit 176d5e0d37
14 changed files with 81 additions and 80 deletions

View File

@@ -14,7 +14,7 @@ impl SystemTransaction {
pub fn new_program_account(
from_keypair: &Keypair,
to: Pubkey,
last_id: Hash,
recent_block_hash: Hash,
tokens: u64,
space: u64,
program_id: Pubkey,
@@ -30,7 +30,7 @@ impl SystemTransaction {
&[to],
system_program::id(),
&create,
last_id,
recent_block_hash,
fee,
)
}
@@ -40,16 +40,16 @@ impl SystemTransaction {
from_keypair: &Keypair,
to: Pubkey,
tokens: u64,
last_id: Hash,
recent_block_hash: Hash,
fee: u64,
) -> Transaction {
let program_id = system_program::id();
Self::new_program_account(from_keypair, to, last_id, 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(
from_keypair: &Keypair,
last_id: Hash,
recent_block_hash: Hash,
program_id: Pubkey,
fee: u64,
) -> Transaction {
@@ -59,7 +59,7 @@ impl SystemTransaction {
&[],
system_program::id(),
&assign,
last_id,
recent_block_hash,
fee,
)
}
@@ -68,7 +68,7 @@ impl SystemTransaction {
from_keypair: &Keypair,
to: Pubkey,
tokens: u64,
last_id: Hash,
recent_block_hash: Hash,
fee: u64,
) -> Transaction {
let move_tokens = SystemInstruction::Move { tokens };
@@ -77,7 +77,7 @@ impl SystemTransaction {
&[to],
system_program::id(),
&move_tokens,
last_id,
recent_block_hash,
fee,
)
}
@@ -85,7 +85,7 @@ impl SystemTransaction {
pub fn new_move_many(
from: &Keypair,
moves: &[(Pubkey, u64)],
last_id: Hash,
recent_block_hash: Hash,
fee: u64,
) -> Transaction {
let instructions: Vec<_> = moves
@@ -101,7 +101,7 @@ impl SystemTransaction {
Transaction::new_with_instructions(
&[from],
&to_keys,
last_id,
recent_block_hash,
fee,
vec![system_program::id()],
instructions,