Skip to content

Commit

Permalink
fix(eibc): accept wrong fee (#1638)
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 authored Dec 10, 2024
1 parent 0dbcf79 commit b6d70ff
Show file tree
Hide file tree
Showing 6 changed files with 592 additions and 31 deletions.
2 changes: 1 addition & 1 deletion x/eibc/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
)
packet = channeltypes.NewPacket(transferPacketData.GetBytes(), 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)
rollappPacket = &commontypes.RollappPacket{
RollappId: "testRollappId",
RollappId: "rollapp_1234-1",
Status: commontypes.Status_PENDING,
Type: commontypes.RollappPacket_ON_RECV,
Packet: &packet,
Expand Down
2 changes: 1 addition & 1 deletion x/eibc/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (suite *KeeperTestSuite) TestMsgFulfillOrderAuthorized() {
orderFee: sdk.NewInt(10),
orderRecipient: sample.AccAddress(),
msg: &types.MsgFulfillOrderAuthorized{
RollappId: "rollapp2", // Mismatched Rollapp ID
RollappId: "rollapp_2345-1", // Mismatched Rollapp ID
Price: sdk.NewCoins(sdk.NewInt64Coin("adym", 100)),
Amount: sdk.IntProto{Int: sdk.NewInt(110)},
ExpectedFee: "10",
Expand Down
4 changes: 2 additions & 2 deletions x/eibc/types/fulfill_order_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func (a FulfillOrderAuthorization) ValidateBasic() error {

for _, criteria := range a.Rollapps {
// Validate that rollapp_id is not empty
if len(criteria.RollappId) == 0 {
return errorsmod.Wrapf(errors.ErrInvalidRequest, "rollapp_id cannot be empty")
if err := validateRollappID(criteria.RollappId); err != nil {
return errorsmod.Wrapf(errors.ErrInvalidRequest, err.Error())
}

// Check for duplicate rollapp_ids
Expand Down
Loading

0 comments on commit b6d70ff

Please sign in to comment.