examples: Simplify tutorials/basic-3 test (#337)
This commit is contained in:
parent
70eb821516
commit
2f5a7d2cee
|
@ -1,7 +1,7 @@
|
||||||
use anchor_lang::prelude::*;
|
use anchor_lang::prelude::*;
|
||||||
|
|
||||||
#[program]
|
#[program]
|
||||||
mod puppet {
|
pub mod puppet {
|
||||||
use super::*;
|
use super::*;
|
||||||
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
|
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -19,17 +19,7 @@ describe("basic-3", () => {
|
||||||
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
|
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
|
||||||
},
|
},
|
||||||
signers: [newPuppetAccount],
|
signers: [newPuppetAccount],
|
||||||
instructions: [
|
instructions: [await puppet.account.puppet.createInstruction(newPuppetAccount)],
|
||||||
anchor.web3.SystemProgram.createAccount({
|
|
||||||
fromPubkey: provider.wallet.publicKey,
|
|
||||||
newAccountPubkey: newPuppetAccount.publicKey,
|
|
||||||
space: 8 + 8, // Add 8 for the account discriminator.
|
|
||||||
lamports: await provider.connection.getMinimumBalanceForRentExemption(
|
|
||||||
8 + 8
|
|
||||||
),
|
|
||||||
programId: puppet.programId,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Invoke the puppet master to perform a CPI to the puppet.
|
// Invoke the puppet master to perform a CPI to the puppet.
|
||||||
|
|
Loading…
Reference in New Issue