wormchain: tokenbridge: Reject transfers with negative fee
This commit is contained in:
parent
317c0cf7c9
commit
3e6b92a1f6
|
@ -118,6 +118,9 @@ func (k msgServer) ExecuteVAA(goCtx context.Context, msg *types.MsgExecuteVAA) (
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if fee.Sign() == -1 {
|
||||
return nil, types.ErrNegativeFee
|
||||
}
|
||||
|
||||
if wrapped {
|
||||
err = k.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.Coins{
|
||||
|
|
|
@ -37,4 +37,5 @@ var (
|
|||
ErrFeeTooHigh = sdkerrors.Register(ModuleName, 1132, "fee must be < amount")
|
||||
ErrAmountTooHigh = sdkerrors.Register(ModuleName, 1133, "the amount would exceed the bridges capacity of u64")
|
||||
ErrAssetMetaRollback = sdkerrors.Register(ModuleName, 1134, "asset meta must have a higher sequence than the last update")
|
||||
ErrNegativeFee = sdkerrors.Register(ModuleName, 1135, "fee cannot be negative")
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue