@@ -44,7 +44,7 @@ const relay = async (chainId: number, nonce: number) => {
44
44
45
45
const [ proof , [ to , data ] ] = await Promise . all ( [
46
46
getProofAtCount ( chainId , nonce , count ) ,
47
- getMessageDataToRelay ( chainId , nonce ) ,
47
+ getMessageDataToRelay ( chainId , routeParams . veaInboxAddress , nonce ) ,
48
48
] ) ;
49
49
50
50
const txn = await veaOutbox . sendMessage ( proof , nonce , to , data ) ;
@@ -112,7 +112,7 @@ const relayBatch = async ({
112
112
}
113
113
const [ proof , [ to , data ] ] = await Promise . all ( [
114
114
fetchProofAtCount ( chainId , nonce , count ) ,
115
- fetchMessageDataToRelay ( chainId , nonce ) ,
115
+ fetchMessageDataToRelay ( chainId , routeParams . veaInboxAddress , nonce ) ,
116
116
] ) ;
117
117
try {
118
118
await veaOutboxInstance . methods . sendMessage ( proof , nonce , to , data ) . call ( ) ;
@@ -162,12 +162,12 @@ const relayAllFrom = async (chainId: number, nonce: number, msgSender: string):
162
162
163
163
let txns = [ ] ;
164
164
165
- const nonces = await getNonceFrom ( chainId , nonce , msgSender ) ;
165
+ const nonces = await getNonceFrom ( chainId , routeParams . veaInboxAddress , nonce , msgSender ) ;
166
166
167
167
for ( const x of nonces ) {
168
168
const [ proof , [ to , data ] ] = await Promise . all ( [
169
169
getProofAtCount ( chainId , x , count ) ,
170
- getMessageDataToRelay ( chainId , x ) ,
170
+ getMessageDataToRelay ( chainId , routeParams . veaInboxAddress , x ) ,
171
171
] ) ;
172
172
txns . push ( {
173
173
args : [ proof , x , to , data ] ,
@@ -188,7 +188,7 @@ const relayAllFrom = async (chainId: number, nonce: number, msgSender: string):
188
188
* @param msgSender The address of the sender
189
189
* @returns The nonces of the messages sent by the sender
190
190
*/
191
- const getNonceFrom = async ( chainId : number , nonce : number , msgSender : string ) => {
191
+ const getNonceFrom = async ( chainId : number , inbox : string , nonce : number , msgSender : string ) => {
192
192
const subgraph = getInboxSubgraph ( chainId ) ;
193
193
194
194
const result = await request (
@@ -197,6 +197,7 @@ const getNonceFrom = async (chainId: number, nonce: number, msgSender: string) =
197
197
messageSents(
198
198
first: 1000,
199
199
where: {
200
+ inbox: "${ inbox } ",
200
201
nonce_gte: ${ nonce } ,
201
202
msgSender_: {id: "${ msgSender } "}
202
203
},
0 commit comments