Skip to content

Commit

Permalink
Flush out RPC issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrl committed Sep 4, 2024
1 parent e74a59c commit 731ac10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,20 @@ describe("Utils test", () => {
const provider = new providers.JsonRpcProvider(rpcUrl, 1);
const spokePool: SpokePool = SpokePool__factory.connect(spokePoolAddress, provider);

let i = 0;
console.log(`xxx ${++i}.`);
const gasPrice = await provider.getGasPrice();

const deposit = buildDepositForRelayerFeeTest("1", "usdc", 10, 1);
console.log(`xxx ${++i}.`);
const fill = await populateV3Relay(spokePool, deposit, relayerAddress);
console.log(`xxx ${++i}.`);
const { nativeGasCost: refGasCost, tokenGasCost: refGasEstimate } =
await estimateTotalGasRequiredByUnsignedTransaction(fill, relayerAddress, provider, 0.0, gasPrice);
expect(toBN(refGasEstimate).eq(toBN(refGasCost).mul(gasPrice))).to.be.true;

for (let gasMarkup = -0.99; gasMarkup <= 4.0; gasMarkup += 0.33) {
console.log(`xxx ${++i}.`);
const { nativeGasCost, tokenGasCost } = await estimateTotalGasRequiredByUnsignedTransaction(
fill,
relayerAddress,
Expand Down

0 comments on commit 731ac10

Please sign in to comment.