Skip to content

Commit

Permalink
Merge pull request #179 from VenusProtocol/fix-trusted-remote-null
Browse files Browse the repository at this point in the history
fix: decode layerzero id as i32
  • Loading branch information
coreyar authored Sep 19, 2024
2 parents 99d7ebf + 0e25a2e commit 557a9c9
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 557a9c9

Please sign in to comment.