diff --git a/src/plugins/safeSnap/utils/umaModule.ts b/src/plugins/safeSnap/utils/umaModule.ts index a79f4ad10fd8..7a258c1219a6 100644 --- a/src/plugins/safeSnap/utils/umaModule.ts +++ b/src/plugins/safeSnap/utils/umaModule.ts @@ -96,14 +96,11 @@ const findAssertionsGql = async ( return result?.assertions ?? []; }; // Search optimistic governor for individual proposal -const findProposalGql = async ( - network: string, - params: { ogAddress: string; proposalHash: string } -) => { +const findProposalGql = async (network: string, params: { assertionId }) => { const subgraph = getOptimisticGovernorSubgraph(network); const request = ` { - proposal(id:"${params.ogAddress.toLowerCase()}-${params.proposalHash.toLowerCase()}"){ + proposal(id:"${assertionId}"){ id executed } @@ -300,9 +297,9 @@ export const getModuleDetailsUma = async ( // Get the full proposal events (with state). const fullAssertionEvent = await Promise.all( thisModuleAssertionEvent.map(async event => { - const assertion = await oracleContract.getAssertion( + const assertion = (await oracleContract.getAssertion( event.args?.assertionId - ) as Promise<{ + )) as Promise<{ expirationTime: BigNumber; settled: boolean; }>; @@ -311,7 +308,7 @@ export const getModuleDetailsUma = async ( Math.floor(Date.now() / 1000) >= assertion.expirationTime.toNumber(); return { - assertionId:event?.args?.assertionId, + assertionId: event?.args?.assertionId, expirationTimestamp: assertion.expirationTime, isExpired: isExpired, isSettled: assertion.settled, @@ -465,10 +462,11 @@ export const getModuleDetailsUmaGql = async ( } : undefined; - const proposal = await findProposalGql(network, { - ogAddress:moduleAddress, - proposalHash, - }); + const proposal = assertionEvent.assertionId + ? await findProposalGql(network, { + assertionId: assertionEvent.assertionId + }) + : undefined; const proposalExecuted = proposal?.executed ? true : false; return {