Skip to content

Commit

Permalink
test: instruction params account is closed
Browse files Browse the repository at this point in the history
Signed-off-by: Reinis Martinsons <[email protected]>
  • Loading branch information
Reinis-FRP committed Jan 8, 2025
1 parent 50cfd90 commit 71aac65
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/svm/SvmSpoke.Bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,23 @@ describe("svm_spoke.bundle", () => {
program: program.programId,
};
const proofAsNumbers = proof.map((p) => Array.from(p));
await loadExecuteRelayerRefundLeafParams(program, owner, stateAccountData.rootBundleId, leaf, proofAsNumbers);
const instructionParams = await loadExecuteRelayerRefundLeafParams(
program,
owner,
stateAccountData.rootBundleId,
leaf,
proofAsNumbers
);
const tx = await program.methods
.executeRelayerRefundLeaf()
.accounts(executeRelayerRefundLeafAccounts)
.remainingAccounts(remainingAccounts)
.rpc();

// Verify the instruction params account has been automatically closed.
const instructionParamsInfo = await program.provider.connection.getAccountInfo(instructionParams);
assert.isNull(instructionParamsInfo, "Instruction params account should be closed");

// Verify the ExecutedRelayerRefundRoot event
let events = await readEventsUntilFound(connection, tx, [program]);
let event = events.find((event) => event.name === "executedRelayerRefundRoot")?.data;
Expand Down

0 comments on commit 71aac65

Please sign in to comment.