Skip to content

Commit

Permalink
fix
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 13, 2024
1 parent cedbd26 commit d1d0b01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
36 changes: 18 additions & 18 deletions test/svm/SvmSpoke.Fill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("svm_spoke.fill", () => {
const payer = (anchor.AnchorProvider.env().wallet as anchor.Wallet).payer;
const relayer = Keypair.generate();
const otherRelayer = Keypair.generate();
const { encodedMessage, remainingAccounts } = testAcrossPlusMessage();
const { encodedMessage, fillRemainingAccounts } = testAcrossPlusMessage();

let state: PublicKey, mint: PublicKey, relayerTA: PublicKey, recipientTA: PublicKey, otherRelayerTA: PublicKey;

Expand Down Expand Up @@ -105,7 +105,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand All @@ -127,7 +127,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(420), otherRelayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand All @@ -154,7 +154,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();
assert.fail("Fill should have failed due to fill deadline passed");
Expand All @@ -172,7 +172,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([otherRelayer])
.rpc();
assert.fail("Fill should have failed due to non-exclusive relayer before exclusivity deadline");
Expand All @@ -194,7 +194,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([otherRelayer])
.rpc();

Expand Down Expand Up @@ -222,7 +222,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand All @@ -231,7 +231,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();
assert.fail("Fill should have failed due to RelayFilled error");
Expand All @@ -254,7 +254,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand Down Expand Up @@ -297,7 +297,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(Array.from(relayHash), relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand All @@ -321,7 +321,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();
assert.fail("Should not be able to fill relay when fills are paused");
Expand All @@ -346,7 +346,7 @@ describe("svm_spoke.fill", () => {
recipientTokenAccount: wrongRecipientTA,
fillStatus: wrongFillStatus,
})
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();
assert.fail("Should not be able to fill relay to wrong recipient token account");
Expand Down Expand Up @@ -375,7 +375,7 @@ describe("svm_spoke.fill", () => {
relayerTokenAccount: wrongRelayerTA,
recipientTokenAccount: wrongRecipientTA,
})
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();
assert.fail("Should not be able to process fill for inconsistent mint");
Expand All @@ -397,7 +397,7 @@ describe("svm_spoke.fill", () => {
const txSignature = await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand Down Expand Up @@ -435,7 +435,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, relayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();

Expand Down Expand Up @@ -468,7 +468,7 @@ describe("svm_spoke.fill", () => {
await program.methods
.fillV3Relay(relayHash, newRelayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.signers([relayer])
.rpc();
assert.fail("Fill should have failed due to missing ATA");
Expand All @@ -490,7 +490,7 @@ describe("svm_spoke.fill", () => {
const fillInstruction = await program.methods
.fillV3Relay(relayHash, newRelayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.instruction();

// Create and send the transaction
Expand Down Expand Up @@ -537,7 +537,7 @@ describe("svm_spoke.fill", () => {
const fillInstruction = await program.methods
.fillV3Relay(relayHash, newRelayData, new BN(1), relayer.publicKey)
.accounts(accounts)
.remainingAccounts(remainingAccounts)
.remainingAccounts(fillRemainingAccounts)
.instruction();
fillInstructions.push(fillInstruction);
}
Expand Down
6 changes: 3 additions & 3 deletions test/svm/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export async function loadExecuteRelayerRefundLeafParams(
return instructionParams;
}

// Encodes empty list of multicall handler instructions to be used as a test message field.
// Encodes empty list of multicall handler instructions to be used as a test message field for fills.
export function testAcrossPlusMessage() {
const handlerProgram = workspace.MulticallHandler as Program<MulticallHandler>;
const multicallHandlerCoder = new MulticallHandlerCoder([]);
Expand All @@ -288,9 +288,9 @@ export function testAcrossPlusMessage() {
handlerMessage,
});
const encodedMessage = message.encode();
const remainingAccounts: AccountMeta[] = [
const fillRemainingAccounts: AccountMeta[] = [
{ pubkey: handlerProgram.programId, isSigner: false, isWritable: false },
...multicallHandlerCoder.compiledKeyMetas,
];
return { encodedMessage, remainingAccounts };
return { encodedMessage, fillRemainingAccounts };
}

0 comments on commit d1d0b01

Please sign in to comment.