Rename tokens to lamports in programs/

This commit is contained in:
Michael Vines
2019-03-05 17:27:25 -08:00
parent 0604bbb473
commit 3129e299e4
11 changed files with 77 additions and 71 deletions

View File

@ -229,9 +229,9 @@ pub fn clear_credits(keyed_accounts: &mut [KeyedAccount]) -> Result<(), ProgramE
Ok(())
}
pub fn create_vote_account(tokens: u64) -> Account {
pub fn create_vote_account(lamports: u64) -> Account {
let space = VoteState::max_size();
Account::new(tokens, space, id())
Account::new(lamports, space, id())
}
pub fn initialize_and_deserialize(

View File

@ -26,12 +26,12 @@ impl VoteTransaction {
.sign(&[voting_keypair], recent_blockhash)
}
/// Fund or create the staking account with tokens
/// Fund or create the staking account with lamports
pub fn new_account(
from_keypair: &Keypair,
voter_id: Pubkey,
recent_blockhash: Hash,
num_tokens: u64,
lamports: u64,
fee: u64,
) -> Transaction {
let from_id = from_keypair.pubkey();
@ -40,7 +40,7 @@ impl VoteTransaction {
.push(SystemInstruction::new_program_account(
from_id,
voter_id,
num_tokens,
lamports,
space,
id(),
))
@ -48,13 +48,13 @@ impl VoteTransaction {
.sign(&[from_keypair], recent_blockhash)
}
/// Fund or create the staking account with tokens
/// Fund or create the staking account with lamports
pub fn new_account_with_delegate(
from_keypair: &Keypair,
voter_keypair: &Keypair,
delegate_id: Pubkey,
recent_blockhash: Hash,
num_tokens: u64,
lamports: u64,
fee: u64,
) -> Transaction {
let from_id = from_keypair.pubkey();
@ -64,7 +64,7 @@ impl VoteTransaction {
.push(SystemInstruction::new_program_account(
from_id,
voter_id,
num_tokens,
lamports,
space,
id(),
))