Skip to content

Commit b6ef399

Browse files
authored
fix(warp): relax payload size constraints (#163)
1 parent 0afaa4a commit b6ef399

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ An '!' indicates a state machine breaking change.
2323

2424
### Bug Fixes
2525

26+
- ! [#163](https://github.com/bcp-innovations/hyperlane-cosmos/pull/163) Fix warp payload length check
2627
- [#157](https://github.com/bcp-innovations/hyperlane-cosmos/pull/157) Fix Amino JSON signing for ISM `MsgSetRoutingIsmDomain`, warp `MsgEnrollRemoteRouter`, and post_dispatch `MsgSetDestinationGasConfig`.
2728
- ! [#148](https://github.com/bcp-innovations/hyperlane-cosmos/pull/148) Fix Amino name typos in warp.
2829
- ! [#153](https://github.com/bcp-innovations/hyperlane-cosmos/pull/153) Fix SetDomain for RoutingISM.

x/warp/types/payload.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ func NewWarpPayload(recipient []byte, amount big.Int) (WarpPayload, error) {
2626
}
2727

2828
func ParseWarpPayload(payload []byte) (WarpPayload, error) {
29-
if len(payload) != 64 {
30-
return WarpPayload{}, errors.New("payload is invalid")
29+
if len(payload) < 64 {
30+
return WarpPayload{}, errors.New("payload is invalid. Expected at least 64 bytes")
3131
}
3232

33-
amount := big.NewInt(0).SetBytes(payload[32:])
33+
amount := big.NewInt(0).SetBytes(payload[32:64])
3434

3535
return WarpPayload{
3636
recipient: payload[0:32],

0 commit comments

Comments
 (0)