Skip to content

Commit

Permalink
fix: chain id in all path test
Browse files Browse the repository at this point in the history
  • Loading branch information
ameeshaagrawal committed Oct 13, 2023
1 parent 28cb938 commit e1d6692
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const config: HardhatUserConfig = {
apiURL: "https://api-goerli.arbiscan.io/api",
browserURL: "https://goerli.arbiscan.io/",
},
}
},
],
},
networks: {
Expand Down
22 changes: 13 additions & 9 deletions scripts/deploy/scripts/allPathTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
isMainnet,
CORE_CONTRACTS,
ChainSlugToKey,
ChainId,
} from "../../../src";
import { getAddresses, getRelayUrl, getRelayAPIKEY } from "../utils";
import { BigNumber, Contract, ethers } from "ethers";
Expand Down Expand Up @@ -66,7 +67,7 @@ const axiosPost = async (url: string, data: object, config = {}) => {
}
};

const relayTx = async (params: RequestObj) => {
const relayTx = async (params: RequestObj, provider: any) => {
try {
let { to, data, chainSlug, gasPrice, value, gasLimit } = params;
let url = await getRelayUrl(mode);
Expand All @@ -80,7 +81,7 @@ const relayTx = async (params: RequestObj) => {
to,
data,
value,
chainId: chainSlug,
chainId: (await provider.getNetwork()).chainId,
gasLimit,
gasPrice,
sequential: false,
Expand Down Expand Up @@ -190,13 +191,16 @@ export const sendMessagesToAllPaths = async (params: {
await Promise.all(
tempArray.map(async (c) => {
// console.log(c)
let response = await relayTx({
to,
data,
value,
gasLimit,
chainSlug,
});
let response = await relayTx(
{
to,
data,
value,
gasLimit,
chainSlug,
},
provider
);
console.log(
`Tx sent : ${chainSlug} -> ${siblingSlug} hash: `,
response?.hash
Expand Down

0 comments on commit e1d6692

Please sign in to comment.