Rename tokens to lamports in sdk/

This commit is contained in:
Michael Vines
2019-03-05 16:28:14 -08:00
parent bd237a2d6f
commit 53f09c44f3
33 changed files with 324 additions and 306 deletions

View File

@ -7,35 +7,35 @@ pub enum SystemInstruction {
/// Create a new account
/// * Transaction::keys[0] - source
/// * Transaction::keys[1] - new account key
/// * tokens - number of tokens to transfer to the new account
/// * lamports - number of lamports to transfer to the new account
/// * space - memory to allocate if greater then zero
/// * program_id - the program id of the new account
CreateAccount {
tokens: u64,
lamports: u64,
space: u64,
program_id: Pubkey,
},
/// Assign account to a program
/// * Transaction::keys[0] - account to assign
Assign { program_id: Pubkey },
/// Move tokens
/// Move lamports
/// * Transaction::keys[0] - source
/// * Transaction::keys[1] - destination
Move { tokens: u64 },
Move { lamports: u64 },
}
impl SystemInstruction {
pub fn new_program_account(
from_id: Pubkey,
to_id: Pubkey,
tokens: u64,
lamports: u64,
space: u64,
program_id: Pubkey,
) -> BuilderInstruction {
BuilderInstruction::new(
system_program::id(),
&SystemInstruction::CreateAccount {
tokens,
lamports,
space,
program_id,
},
@ -43,10 +43,10 @@ impl SystemInstruction {
)
}
pub fn new_move(from_id: Pubkey, to_id: Pubkey, tokens: u64) -> BuilderInstruction {
pub fn new_move(from_id: Pubkey, to_id: Pubkey, lamports: u64) -> BuilderInstruction {
BuilderInstruction::new(
system_program::id(),
&SystemInstruction::Move { tokens },
&SystemInstruction::Move { lamports },
vec![(from_id, true), (to_id, false)],
)
}