Skip to content

Commit

Permalink
fix: fix broken gql call, narrow block query range
Browse files Browse the repository at this point in the history
Signed-off-by: david <david@umaproject.org>
  • Loading branch information
daywiss committed Aug 16, 2023
1 parent 5476afc commit 7fb203e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/safeSnap/utils/umaModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import filter from 'lodash/filter';

function getDeployBlock(network: string, name: string): number {
const data = filter(contractData, { network, name });
if (data.length === 1) return data[0].deployBlock;
if (data.length === 1) return data[0].deployBlock ?? 0;
return 0;
}
function getContractSubgraph(search: {
Expand Down Expand Up @@ -103,7 +103,7 @@ const findProposalGql = async (
const subgraph = getOptimisticGovernorSubgraph(network);
const request = `
{
proposals(where:{proposalHash:"${params.proposalHash}",explanation:"${params.explanation}",ogAddress:"${params.ogAddress}"}){
proposals(where:{proposalHash:"${params.proposalHash}",explanation:"${params.explanation}",optimisticGovernor:"${params.ogAddress}"}){
id
executed
assertionId
Expand Down Expand Up @@ -249,7 +249,7 @@ export const getModuleDetailsUma = async (
// this needs to be optimized to reduce loading time, currently takes a long time to parse 3k blocks at a time.
const oGstartBlock = getDeployBlock(network, 'OptimisticGovernor');
const oOStartBlock = getDeployBlock(network, 'OptimisticOracleV3');
const maxRange = network === '1' || network === '5' ? 3000 : 10000;
const maxRange = 3000;

const [assertionEvents, transactionsProposedEvents, executionEvents] =
await Promise.all([
Expand Down

0 comments on commit 7fb203e

Please sign in to comment.