@@ -47,20 +47,11 @@ describe("cross-program-invocation", () => {
4747
4848 // Call the pullLever instruction on the hand program, which invokes the lever program via CPI
4949 const tx2 = await handProgram . methods
50- . pullLever ( dataAccountLever . publicKey , "Chris" )
51- . accounts ( { dataAccount : dataAccountHand . publicKey } )
52- . remainingAccounts ( [
53- {
54- pubkey : dataAccountLever . publicKey , // The lever program's data account, which stores the state
55- isWritable : true ,
56- isSigner : false ,
57- } ,
58- {
59- pubkey : leverProgram . programId , // The lever program's program ID
60- isWritable : false ,
61- isSigner : false ,
62- } ,
63- ] )
50+ . pullLever ( "Chris" )
51+ . accounts ( {
52+ leverData : dataAccountLever . publicKey , // The lever program's data account, which stores the state
53+ leverInterface_programId : leverProgram . programId // The lever program's program ID
54+ } )
6455 . rpc ( { skipPreflight : true } ) ;
6556 console . log ( "Your transaction signature" , tx2 ) ;
6657
@@ -76,20 +67,11 @@ describe("cross-program-invocation", () => {
7667 it ( "Pull it again!" , async ( ) => {
7768 // Call the pullLever instruction on the hand program, which invokes the lever program via CPI
7869 const tx = await handProgram . methods
79- . pullLever ( dataAccountLever . publicKey , "Ashley" )
80- . accounts ( { dataAccount : dataAccountHand . publicKey } )
81- . remainingAccounts ( [
82- {
83- pubkey : dataAccountLever . publicKey , // The lever program's data account, which stores the state
84- isWritable : true ,
85- isSigner : false ,
86- } ,
87- {
88- pubkey : leverProgram . programId , // The lever program's program ID
89- isWritable : false ,
90- isSigner : false ,
91- } ,
92- ] )
70+ . pullLever ( "Ashley" )
71+ . accounts ( {
72+ leverData : dataAccountLever . publicKey , // The lever program's data account, which stores the state
73+ leverInterface_programId : leverProgram . programId , // The lever program's program ID
74+ } )
9375 . rpc ( { skipPreflight : true } ) ;
9476
9577 console . log ( "Your transaction signature" , tx ) ;
0 commit comments