Rename 'new_account' to 'new_user_account'

And 'new_program_account' to 'new_account'
This commit is contained in:
Greg Fitzgerald
2019-04-02 17:01:56 -06:00
parent 7b82e96467
commit 43bb813cbe
32 changed files with 107 additions and 86 deletions

View File

@ -51,7 +51,7 @@ impl BudgetInstruction {
}
let space = serialized_size(&BudgetState::new(expr.clone())).unwrap();
vec![
SystemInstruction::new_program_account(&from, contract, lamports, space, &id()),
SystemInstruction::new_account(&from, contract, lamports, space, &id()),
BudgetInstruction::new_initialize_account(contract, expr),
]
}

View File

@ -13,7 +13,7 @@ impl ConfigInstruction {
config_account_pubkey: &Pubkey,
lamports: u64,
) -> Instruction {
SystemInstruction::new_program_account(
SystemInstruction::new_account(
from_account_pubkey,
config_account_pubkey,
lamports,

View File

@ -527,7 +527,7 @@ mod test {
fn create_account(client: &BankClient, owner: &Keypair) -> Pubkey {
let new = Pubkey::new_rand();
let instruction = SystemInstruction::new_program_account(
let instruction = SystemInstruction::new_account(
&owner.pubkey(),
&new,
1,
@ -542,7 +542,7 @@ mod test {
fn create_token_account(client: &BankClient, owner: &Keypair) -> Pubkey {
let new = Pubkey::new_rand();
let instruction = SystemInstruction::new_program_account(
let instruction = SystemInstruction::new_account(
&owner.pubkey(),
&new,
1,

View File

@ -19,7 +19,7 @@ impl ExchangeTransaction {
) -> Transaction {
let owner_id = &owner.pubkey();
let space = mem::size_of::<ExchangeState>() as u64;
let create_ix = SystemInstruction::new_program_account(owner_id, new, 1, space, &id());
let create_ix = SystemInstruction::new_account(owner_id, new, 1, space, &id());
let request_ix = ExchangeInstruction::new_account_request(owner_id, new);
Transaction::new_signed_instructions(
&[owner],
@ -58,7 +58,7 @@ impl ExchangeTransaction {
) -> Transaction {
let owner_id = &owner.pubkey();
let space = mem::size_of::<ExchangeState>() as u64;
let create_ix = SystemInstruction::new_program_account(owner_id, trade, 1, space, &id());
let create_ix = SystemInstruction::new_account(owner_id, trade, 1, space, &id());
let request_ix = ExchangeInstruction::new_trade_request(
owner_id,
trade,
@ -101,7 +101,7 @@ impl ExchangeTransaction {
) -> Transaction {
let owner_id = &owner.pubkey();
let space = mem::size_of::<ExchangeState>() as u64;
let create_ix = SystemInstruction::new_program_account(owner_id, swap, 1, space, &id());
let create_ix = SystemInstruction::new_account(owner_id, swap, 1, space, &id());
let request_ix = ExchangeInstruction::new_swap_request(
owner_id,
swap,

View File

@ -24,7 +24,7 @@ pub enum StakeInstruction {
impl StakeInstruction {
pub fn new_account(from_id: &Pubkey, staker_id: &Pubkey, lamports: u64) -> Vec<Instruction> {
vec![SystemInstruction::new_program_account(
vec![SystemInstruction::new_account(
from_id,
staker_id,
lamports,

View File

@ -386,8 +386,7 @@ mod tests {
.transfer(10, &alice_keypair, &jack_pubkey)
.unwrap();
let ix =
SystemInstruction::new_program_account(&alice_pubkey, &bob_pubkey, 1, 4 * 1024, &id());
let ix = SystemInstruction::new_account(&alice_pubkey, &bob_pubkey, 1, 4 * 1024, &id());
bank_client.process_instruction(&alice_keypair, ix).unwrap();

View File

@ -45,8 +45,7 @@ impl VoteInstruction {
pub fn new_account(from_id: &Pubkey, staker_id: &Pubkey, lamports: u64) -> Vec<Instruction> {
let space = VoteState::max_size() as u64;
let create_ix =
SystemInstruction::new_program_account(&from_id, staker_id, lamports, space, &id());
let create_ix = SystemInstruction::new_account(&from_id, staker_id, lamports, space, &id());
let init_ix = VoteInstruction::new_initialize_account(staker_id);
vec![create_ix, init_ix]
}