Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
keithsue committed Jun 19, 2024
2 parents df601c1 + 44456c4 commit 385b97e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions x/btcbridge/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,17 @@ func (m msgServer) WithdrawBitcoin(goCtx context.Context, msg *types.MsgWithdraw
}
ctx := sdk.UnwrapSDKContext(goCtx)

sender := sdk.AccAddress(msg.Sender)
sender := sdk.MustAccAddressFromBech32(msg.Sender)

coin, err := sdk.ParseCoinNormalized(msg.Amount)
if err != nil {
return nil, err
}

balance := m.bankKeeper.GetBalance(ctx, sender, coin.Denom)

if balance.Amount.LT(coin.Amount) {
return nil, types.ErrInsufficientBalance
if err = m.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, sdk.NewCoins(coin)); err != nil {
return nil, err
}

m.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, sdk.NewCoins(coin))

_, err = m.Keeper.NewSigningRequest(ctx, msg.Sender, coin, msg.FeeRate, "")
if err != nil {
return nil, err
Expand Down

0 comments on commit 385b97e

Please sign in to comment.