From f8276be2b88752f1cd9812da29885301c9979df8 Mon Sep 17 00:00:00 2001 From: Armani Ferrante Date: Fri, 3 Sep 2021 11:01:35 -0700 Subject: [PATCH] client: Fix example (#671) --- client/example/Cargo.toml | 1 + client/example/src/main.rs | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/client/example/Cargo.toml b/client/example/Cargo.toml index cc33da129..4c01643fd 100644 --- a/client/example/Cargo.toml +++ b/client/example/Cargo.toml @@ -16,3 +16,4 @@ shellexpand = "2.1.0" anyhow = "1.0.32" rand = "0.7.3" clap = "3.0.0-beta.2" +solana-sdk = "1.7.11" \ No newline at end of file diff --git a/client/example/src/main.rs b/client/example/src/main.rs index 45698f129..ddec2d9d7 100644 --- a/client/example/src/main.rs +++ b/client/example/src/main.rs @@ -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()?;