Skip to content

Commit

Permalink
fix: update refund script
Browse files Browse the repository at this point in the history
Signed-off-by: Reinis Martinsons <[email protected]>
  • Loading branch information
Reinis-FRP committed Nov 1, 2024
1 parent a809151 commit 86b11a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/svm/simpleFakeRelayerRepayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ async function testBundleLogic(): Promise<void> {
.rpc();
console.log(`Deposit transaction sent: ${depositTx}`);

// Create a single repayment leaf with the array of amounts and corresponding refund accounts
// Create a single repayment leaf with the array of amounts and corresponding refund addresses
const refundAddresses: PublicKey[] = [];
const refundAccounts: PublicKey[] = [];
for (let i = 0; i < amounts.length; i++) {
const recipient = Keypair.generate();
Expand All @@ -122,6 +123,7 @@ async function testBundleLogic(): Promise<void> {
inputToken,
recipient.publicKey
);
refundAddresses.push(recipient.publicKey);
refundAccounts.push(refundAccount);
console.log(
`Created refund account for recipient ${
Expand All @@ -138,7 +140,7 @@ async function testBundleLogic(): Promise<void> {
chainId: new BN((await program.account.state.fetch(statePda)).chainId), // set chainId to svm spoke chainId.
amountToReturn: new BN(0),
mintPublicKey: inputToken,
refundAccounts: refundAccounts, // Array of refund accounts
refundAddresses, // Array of refund authority addresses
refundAmounts: amounts, // Array of amounts
};

Expand Down

0 comments on commit 86b11a0

Please sign in to comment.