|
@@ -5,6 +5,7 @@ use anchor_client::solana_sdk::signature::{Keypair, Signer};
|
|
|
use anchor_client::solana_sdk::system_instruction;
|
|
|
use anchor_client::{Client, Cluster, EventContext};
|
|
|
use anyhow::Result;
|
|
|
+use solana_sdk::system_program;
|
|
|
// The `accounts` and `instructions` modules are generated by the framework.
|
|
|
use basic_2::accounts as basic_2_accounts;
|
|
|
use basic_2::instruction as basic_2_instruction;
|
|
@@ -146,16 +147,11 @@ fn basic_2(client: &Client, pid: Pubkey) -> Result<()> {
|
|
|
// Build and send a transaction.
|
|
|
program
|
|
|
.request()
|
|
|
- .instruction(system_instruction::create_account(
|
|
|
- &authority,
|
|
|
- &counter.pubkey(),
|
|
|
- program.rpc().get_minimum_balance_for_rent_exemption(500)?,
|
|
|
- 500,
|
|
|
- &pid,
|
|
|
- ))
|
|
|
.signer(&counter)
|
|
|
.accounts(basic_2_accounts::Create {
|
|
|
counter: counter.pubkey(),
|
|
|
+ user: authority,
|
|
|
+ system_program: system_program::ID,
|
|
|
})
|
|
|
.args(basic_2_instruction::Create { authority })
|
|
|
.send()?;
|