Skip to content

Commit

Permalink
fix: decode layerzero id as i32
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Sep 18, 2024
1 parent 99d7ebf commit 0e25a2e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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()
Expand Down

0 comments on commit 0e25a2e

Please sign in to comment.