File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import * as anchor from "@coral-xyz/anchor" ;
2+ import { assert } from "chai" ;
23import Idl from "../target/idl/rent_example.json" with { type : "json" } ;
3- import type { RentExample } from "../target/types/rent_example" ;
4+ import type { RentExample } from "../target/types/rent_example.ts " ;
45
5- describe ( "Create a system account" , ( ) => {
6+ describe ( "Anchor: Create a system account" , ( ) => {
67 const provider = anchor . AnchorProvider . env ( ) ;
78 anchor . setProvider ( provider ) ;
89 const wallet = provider . wallet as anchor . Wallet ;
@@ -22,7 +23,6 @@ describe("Create a system account", () => {
2223 const addressDataBuffer = new anchor . BorshCoder (
2324 Idl as anchor . Idl ,
2425 ) . types . encode ( "AddressData" , addressData ) ;
25- console . log ( `Address data buffer length: ${ addressDataBuffer . length } ` ) ;
2626
2727 await program . methods
2828 . createSystemAccount ( addressData )
@@ -32,5 +32,11 @@ describe("Create a system account", () => {
3232 } )
3333 . signers ( [ wallet . payer , newKeypair ] )
3434 . rpc ( ) ;
35+
36+ const newKeypairInfo = await provider . connection . getAccountInfo (
37+ newKeypair . publicKey ,
38+ ) ;
39+
40+ assert . equal ( newKeypairInfo . data . length , addressDataBuffer . length ) ;
3541 } ) ;
3642} ) ;
You can’t perform that action at this time.
0 commit comments