Skip to content

Commit

Permalink
fix: gas limit for flare (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
prodesert22 authored Jul 4, 2023
1 parent b90a310 commit 75765dd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/state/pmulticall/updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ async function fetchChunk(
chainId: ChainId,
): Promise<{ results: string[]; blockNumber: number }> {
console.debug('Fetching chunk', multicallContract, chunk, minBlockNumber);

const chain = getChainByNumber(chainId);
const args: any = [chunk.map((obj) => [obj.address, obj.callData])];
if (chain?.network_type === NetworkType.HEDERA) {
args.push({
gasLimit: 15_000_000,
});
}

let resultsBlockNumber, returnData;
try {
[resultsBlockNumber, returnData] = await multicallContract.aggregate(
chunk.map((obj) => [obj.address, obj.callData]),
{
gasLimit: chain?.network_type === NetworkType.HEDERA ? 15_000_000 : 8_000_000,
},
);
[resultsBlockNumber, returnData] = await multicallContract.aggregate(...args);
} catch (error) {
console.debug('Failed to fetch chunk inside retry', error);
throw error;
Expand Down

1 comment on commit 75765dd

@vercel
Copy link

@vercel vercel bot commented on 75765dd Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.