Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Maree <[email protected]>
  • Loading branch information
chrismaree committed Jan 20, 2025
1 parent f58743d commit 07365e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/svm/instructionParamsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ export async function loadFillV3RelayParams(
/**
* Loads requestV3 slow fill parameters.
*/
export async function loadRequestSlowFillParams(program: Program<SvmSpoke>, signer: Keypair, relayData: RelayData) {
export async function loadRequestV3SlowFillParams(program: Program<SvmSpoke>, signer: Keypair, relayData: RelayData) {
// Close the instruction params account if the caller has used it before.
await closeInstructionParams(program, signer);

// Execute load instructions sequentially.
const maxInstructionParamsFragment = 900; // Should not exceed message size limit when writing to the data account.

const accountCoder = new LargeAccountsCoder(program.idl);
const instructionParamsBytes = await accountCoder.encode("requestSlowFillParams", { relayData });
const instructionParamsBytes = await accountCoder.encode("requestV3SlowFillParams", { relayData });

const loadInstructions: TransactionInstruction[] = [];
loadInstructions.push(
Expand All @@ -154,7 +154,7 @@ export async function loadRequestSlowFillParams(program: Program<SvmSpoke>, sign
/**
* Loads executeV3 slow relay leaf parameters.
*/
export async function loadExecuteSlowRelayLeafParams(
export async function loadExecuteV3SlowRelayLeafParams(
program: Program<SvmSpoke>,
signer: Keypair,
slowFillLeaf: SlowFillLeaf,
Expand All @@ -168,7 +168,7 @@ export async function loadExecuteSlowRelayLeafParams(
const maxInstructionParamsFragment = 900; // Should not exceed message size limit when writing to the data account.

const accountCoder = new LargeAccountsCoder(program.idl);
const instructionParamsBytes = await accountCoder.encode("executeSlowRelayLeafParams", {
const instructionParamsBytes = await accountCoder.encode("executeV3SlowRelayLeafParams", {
slowFillLeaf,
rootBundleId,
proof,
Expand Down
12 changes: 6 additions & 6 deletions test/svm/SvmSpoke.SlowFill.AcrossPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import {
readEventsUntilFound,
calculateRelayEventHashUint8Array,
slowFillHashFn,
loadRequestSlowFillParams,
loadExecuteSlowRelayLeafParams,
loadRequestV3SlowFillParams,
loadExecuteV3SlowRelayLeafParams,
intToU8Array32,
} from "../../src/svm";
import { MulticallHandler } from "../../target/types/multicall_handler";
Expand Down Expand Up @@ -139,17 +139,17 @@ describe("svm_spoke.slow_fill.across_plus", () => {
const requestSlowFillValues: RequestV3SlowFillDataValues = [Array.from(relayHash), leaf.relayData];
let loadRequestParamsInstructions: TransactionInstruction[] = [];
if (bufferParams) {
loadRequestParamsInstructions = await loadRequestSlowFillParams(program, relayer, requestSlowFillValues[1]);
loadRequestParamsInstructions = await loadRequestV3SlowFillParams(program, relayer, requestSlowFillValues[1]);
[requestAccounts.instructionParams] = PublicKey.findProgramAddressSync(
[Buffer.from("instruction_params"), relayer.publicKey.toBuffer()],
program.programId
);
}
const requestSlowFillParams: RequestV3SlowFillDataParams = bufferParams
const requestV3SlowFillParams: RequestV3SlowFillDataParams = bufferParams
? [requestSlowFillValues[0], null]
: requestSlowFillValues;
const requestIx = await program.methods
.requestSlowFill(...requestSlowFillParams)
.requestSlowFill(...requestV3SlowFillParams)
.accounts(requestAccounts)
.instruction();

Expand Down Expand Up @@ -177,7 +177,7 @@ describe("svm_spoke.slow_fill.across_plus", () => {
];
let loadExecuteParamsInstructions: TransactionInstruction[] = [];
if (bufferParams) {
loadExecuteParamsInstructions = await loadExecuteSlowRelayLeafParams(
loadExecuteParamsInstructions = await loadExecuteV3SlowRelayLeafParams(
program,
relayer,
executeSlowRelayLeafValues[1],
Expand Down

0 comments on commit 07365e2

Please sign in to comment.