@@ -33,6 +33,7 @@ import {
3333import { MulticallHandler } from "../../target/types/multicall_handler" ;
3434import { common } from "./SvmSpoke.common" ;
3535import { FillDataParams , FillDataValues } from "../../src/types/svm" ;
36+ import { getDelegatePdaFillRelay } from "./utils" ;
3637const { provider, connection, program, owner, chainId, seedBalance } = common ;
3738const { initializeState, assertSE } = common ;
3839
@@ -49,7 +50,8 @@ describe("svm_spoke.fill.across_plus", () => {
4950 finalRecipientATA : PublicKey ,
5051 state : PublicKey ,
5152 mint : PublicKey ,
52- relayerATA : PublicKey ;
53+ relayerATA : PublicKey ,
54+ seed : BN ;
5355
5456 const relayAmount = 500000 ;
5557 const mintDecimals = 6 ;
@@ -66,6 +68,7 @@ describe("svm_spoke.fill.across_plus", () => {
6668
6769 accounts = {
6870 state,
71+ delegate : getDelegatePdaFillRelay ( relayHashUint8Array , seed , program . programId ) ,
6972 signer : relayer . publicKey ,
7073 instructionParams : program . programId ,
7174 mint : mint ,
@@ -79,11 +82,14 @@ describe("svm_spoke.fill.across_plus", () => {
7982 }
8083
8184 async function createApproveAndFillIx ( multicallHandlerCoder : MulticallHandlerCoder , bufferParams = false ) {
85+ const relayHashUint8Array = calculateRelayHashUint8Array ( relayData , chainId ) ;
86+ const relayHash = Array . from ( relayHashUint8Array ) ;
87+
8288 // Delegate state PDA to pull relayer tokens.
8389 const approveIx = await createApproveCheckedInstruction (
8490 accounts . relayerTokenAccount ,
8591 accounts . mint ,
86- accounts . state ,
92+ getDelegatePdaFillRelay ( relayHashUint8Array , seed , program . programId ) ,
8793 accounts . signer ,
8894 BigInt ( relayAmount ) ,
8995 mintDecimals
@@ -94,8 +100,6 @@ describe("svm_spoke.fill.across_plus", () => {
94100 ...multicallHandlerCoder . compiledKeyMetas ,
95101 ] ;
96102
97- const relayHash = Array . from ( calculateRelayHashUint8Array ( relayData , chainId ) ) ;
98-
99103 // Prepare fill instruction.
100104 const fillV3RelayValues : FillDataValues = [ relayHash , relayData , new BN ( 1 ) , relayer . publicKey ] ;
101105 if ( bufferParams ) {
@@ -133,7 +137,7 @@ describe("svm_spoke.fill.across_plus", () => {
133137 finalRecipient = Keypair . generate ( ) . publicKey ;
134138 finalRecipientATA = ( await getOrCreateAssociatedTokenAccount ( connection , payer , mint , finalRecipient ) ) . address ;
135139
136- ( { state } = await initializeState ( ) ) ;
140+ ( { state, seed } = await initializeState ( ) ) ;
137141
138142 const initialRelayData = {
139143 depositor : finalRecipient ,
0 commit comments