Skip to content

Commit f03f526

Browse files
author
minghinmatthewlam
authored
Message id updates (#225)
* update packing and subnet-evm version * calculate message id output
1 parent cd289b2 commit f03f526

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

abi-bindings/go/Teleporter/TeleporterMessenger/packing.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,35 @@ func PackReceiveCrossChainMessage(messageIndex uint32, relayerRewardAddress comm
9595
return abi.Pack("receiveCrossChainMessage", messageIndex, relayerRewardAddress)
9696
}
9797

98+
// PackCalculateMessageID packs input to form a call to the calculateMessageID function
99+
func PackCalculateMessageID(
100+
sourceBlockchainID [32]byte,
101+
destinationBlockchainID [32]byte,
102+
nonce *big.Int) ([]byte, error) {
103+
abi, err := TeleporterMessengerMetaData.GetAbi()
104+
if err != nil {
105+
return nil, errors.Wrap(err, "failed to get abi")
106+
}
107+
108+
return abi.Pack("calculateMessageID", sourceBlockchainID, destinationBlockchainID, nonce)
109+
}
110+
111+
func PackCalculateMessageIDOutput(messageID [32]byte) ([]byte, error) {
112+
abi, err := TeleporterMessengerMetaData.GetAbi()
113+
if err != nil {
114+
return nil, errors.Wrap(err, "failed to get abi")
115+
}
116+
117+
return abi.PackOutput("calculateMessageID", messageID)
118+
}
119+
98120
// PackMessageReceived packs a MessageReceivedInput to form a call to the messageReceived function
99-
func PackMessageReceived(originChainID ids.ID, messageID *big.Int) ([]byte, error) {
121+
func PackMessageReceived(messageID [32]byte) ([]byte, error) {
100122
abi, err := TeleporterMessengerMetaData.GetAbi()
101123
if err != nil {
102124
return nil, errors.Wrap(err, "failed to get abi")
103125
}
104-
return abi.Pack("messageReceived", originChainID, messageID)
126+
return abi.Pack("messageReceived", messageID)
105127
}
106128

107129
// UnpackMessageReceivedResult attempts to unpack result bytes to a bool indicating whether the message was received

contracts/lib/subnet-evm

Submodule subnet-evm updated 57 files

0 commit comments

Comments
 (0)