From 0e25a2ef794db1c8c662f2ae0a3e69a5407a40c0 Mon Sep 17 00:00:00 2001 From: Corey Rice Date: Wed, 18 Sep 2024 14:31:30 -0300 Subject: [PATCH] fix: decode layerzero id as i32 --- .../src/operations/createRemoteProposals.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subgraphs/venus-governance/src/operations/createRemoteProposals.ts b/subgraphs/venus-governance/src/operations/createRemoteProposals.ts index adc373e5..bbc039a3 100644 --- a/subgraphs/venus-governance/src/operations/createRemoteProposals.ts +++ b/subgraphs/venus-governance/src/operations/createRemoteProposals.ts @@ -27,7 +27,7 @@ const createRemoteProposals = (event: ProposalCreatedV2): void => { '(uint16,bytes,bytes,address)', DYNAMIC_TUPLE_BYTES_PREFIX.concat(acc.calldatas[idx]), )!; - const layerZeroChainId = decoded.toTuple()[0].toBigInt(); + const layerZeroChainId = decoded.toTuple()[0].toI32(); const payload = decoded.toTuple()[1].toBytes(); const payloadDecoded = ethereum .decode( @@ -36,12 +36,12 @@ const createRemoteProposals = (event: ProposalCreatedV2): void => { )! .toTuple(); - const remoteProposalId = Bytes.fromI32(layerZeroChainId.toI32()).concat( + const remoteProposalId = Bytes.fromI32(layerZeroChainId).concat( Bytes.fromByteArray(Bytes.fromBigInt(acc.sourceProposalId)), ); const remoteProposal = new RemoteProposal(remoteProposalId); - remoteProposal.trustedRemote = Bytes.fromI32(layerZeroChainId.toI32()); // default value replaced in event handler + remoteProposal.trustedRemote = Bytes.fromI32(layerZeroChainId); // default value replaced in event handler remoteProposal.sourceProposal = acc.sourceProposalId.toString(); const targets = payloadDecoded[0] .toAddressArray()