wormchain: tokenbridge: Normalize coins before processing
This lets users use non-base denominations when transferring coins.
This commit is contained in:
parent
5e7752c74b
commit
d1b6512954
|
@ -16,6 +16,9 @@ import (
|
||||||
func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
|
func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
|
||||||
|
msg.Amount = sdk.NormalizeCoin(msg.Amount)
|
||||||
|
msg.Fee = sdk.NormalizeCoin(msg.Fee)
|
||||||
|
|
||||||
wormholeConfig, ok := k.wormholeKeeper.GetConfig(ctx)
|
wormholeConfig, ok := k.wormholeKeeper.GetConfig(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, whtypes.ErrNoConfig
|
return nil, whtypes.ErrNoConfig
|
||||||
|
|
Loading…
Reference in New Issue