@@ -25,27 +25,27 @@ const getCount = async (veaOutbox: VeaOutboxArbToEth | VeaOutboxArbToGnosis, cha
2525 return Number ( result [ "snapshotSaveds" ] [ 0 ] . count ) ;
2626} ;
2727
28- const relay = async ( chainid : number , nonce : number ) => {
29- const routeParams = getBridgeConfig ( chainid ) ;
30- const veaOutbox = getVeaOutbox ( routeParams . veaOutboxAddress , process . env . PRIVATE_KEY , routeParams . rpcOutbox , chainid ) ;
31- const count = await getCount ( veaOutbox , chainid ) ;
28+ const relay = async ( chainId : number , nonce : number ) => {
29+ const routeParams = getBridgeConfig ( chainId ) ;
30+ const veaOutbox = getVeaOutbox ( routeParams . veaOutboxAddress , process . env . PRIVATE_KEY , routeParams . rpcOutbox , chainId ) ;
31+ const count = await getCount ( veaOutbox , chainId ) ;
3232
3333 const [ proof , [ to , data ] ] = await Promise . all ( [
34- getProofAtCount ( chainid , nonce , count ) ,
35- getMessageDataToRelay ( chainid , nonce ) ,
34+ getProofAtCount ( chainId , nonce , count ) ,
35+ getMessageDataToRelay ( chainId , nonce ) ,
3636 ] ) ;
3737
3838 const txn = await veaOutbox . sendMessage ( proof , nonce , to , data ) ;
3939 await txn . wait ( ) ;
4040} ;
4141
42- const relayBatch = async ( chainid : number , nonce : number , maxBatchSize : number ) => {
43- const routeParams = getBridgeConfig ( chainid ) ;
42+ const relayBatch = async ( chainId : number , nonce : number , maxBatchSize : number ) => {
43+ const routeParams = getBridgeConfig ( chainId ) ;
4444 const web3 = new Web3 ( routeParams . rpcOutbox ) ;
4545 const batchedSend = initializeBatchedSend ( web3 , routeParams . batcher , process . env . PRIVATE_KEY , 0 ) ;
4646 const veaOutboxInstance = new web3 . eth . Contract ( routeParams . veaOutboxContract . abi , routeParams . veaOutboxAddress ) ;
47- const veaOutbox = getVeaOutbox ( routeParams . veaOutboxAddress , process . env . PRIVATE_KEY , routeParams . rpcOutbox , chainid ) ;
48- const count = await getCount ( veaOutbox , chainid ) ;
47+ const veaOutbox = getVeaOutbox ( routeParams . veaOutboxAddress , process . env . PRIVATE_KEY , routeParams . rpcOutbox , chainId ) ;
48+ const count = await getCount ( veaOutbox , chainId ) ;
4949
5050 while ( nonce < count ) {
5151 let batchMessages = 0 ;
@@ -57,8 +57,8 @@ const relayBatch = async (chainid: number, nonce: number, maxBatchSize: number)
5757 continue ;
5858 }
5959 const [ proof , [ to , data ] ] = await Promise . all ( [
60- getProofAtCount ( chainid , nonce , count ) ,
61- getMessageDataToRelay ( chainid , nonce ) ,
60+ getProofAtCount ( chainId , nonce , count ) ,
61+ getMessageDataToRelay ( chainId , nonce ) ,
6262 ] ) ;
6363 txns . push ( {
6464 args : [ proof , nonce , to , data ] ,
@@ -75,8 +75,8 @@ const relayBatch = async (chainid: number, nonce: number, maxBatchSize: number)
7575 return nonce ;
7676} ;
7777
78- const relayAllFrom = async ( chainid : number , nonce : number , msgSender : string ) : Promise < number > => {
79- const routeParams = getBridgeConfig ( chainid ) ;
78+ const relayAllFrom = async ( chainId : number , nonce : number , msgSender : string ) : Promise < number > => {
79+ const routeParams = getBridgeConfig ( chainId ) ;
8080
8181 const web3 = new Web3 ( routeParams . rpcOutbox ) ;
8282 const batchedSend = initializeBatchedSend (
@@ -88,19 +88,19 @@ const relayAllFrom = async (chainid: number, nonce: number, msgSender: string):
8888 ) ;
8989
9090 const contract = new web3 . eth . Contract ( routeParams . veaOutboxContract . abi , routeParams . veaOutboxAddress ) ;
91- const veaOutbox = getVeaOutbox ( routeParams . veaOutboxAddress , process . env . PRIVATE_KEY , routeParams . rpcOutbox , chainid ) ;
92- const count = await getCount ( veaOutbox , chainid ) ;
91+ const veaOutbox = getVeaOutbox ( routeParams . veaOutboxAddress , process . env . PRIVATE_KEY , routeParams . rpcOutbox , chainId ) ;
92+ const count = await getCount ( veaOutbox , chainId ) ;
9393
9494 if ( ! count ) return null ;
9595
9696 let txns = [ ] ;
9797
98- const nonces = await getNonceFrom ( chainid , nonce , msgSender ) ;
98+ const nonces = await getNonceFrom ( chainId , nonce , msgSender ) ;
9999
100100 for ( const x of nonces ) {
101101 const [ proof , [ to , data ] ] = await Promise . all ( [
102- getProofAtCount ( chainid , x , count ) ,
103- getMessageDataToRelay ( chainid , x ) ,
102+ getProofAtCount ( chainId , x , count ) ,
103+ getMessageDataToRelay ( chainId , x ) ,
104104 ] ) ;
105105 txns . push ( {
106106 args : [ proof , x , to , data ] ,
@@ -114,9 +114,9 @@ const relayAllFrom = async (chainid: number, nonce: number, msgSender: string):
114114 return nonces [ nonces . length - 1 ] ;
115115} ;
116116
117- const getNonceFrom = async ( chainid : number , nonce : number , msgSender : string ) => {
117+ const getNonceFrom = async ( chainId : number , nonce : number , msgSender : string ) => {
118118 try {
119- const subgraph = getInboxSubgraph ( chainid ) ;
119+ const subgraph = getInboxSubgraph ( chainId ) ;
120120
121121 const result = await request (
122122 `https://api.studio.thegraph.com/query/${ subgraph } ` ,
0 commit comments