wormchain: tokenbridge: Normalize coins before processing

This lets users use non-base denominations when transferring coins.
This commit is contained in:
Chirantan Ekbote 2022-08-25 17:31:03 +09:00 committed by Chirantan Ekbote
parent 5e7752c74b
commit d1b6512954
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,9 @@ import (
func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
msg.Amount = sdk.NormalizeCoin(msg.Amount)
msg.Fee = sdk.NormalizeCoin(msg.Fee)
wormholeConfig, ok := k.wormholeKeeper.GetConfig(ctx)
if !ok {
return nil, whtypes.ErrNoConfig