From ec45289b7d959f47bb75e81051bc4bccb9f0fbd1 Mon Sep 17 00:00:00 2001 From: scorpioborn <97235353+scorpioborn@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:47:32 +0300 Subject: [PATCH] fix: unwrap all bet wager errors --- x/bet/keeper/msg_server_bet.go | 2 +- x/bet/keeper/wager.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/bet/keeper/msg_server_bet.go b/x/bet/keeper/msg_server_bet.go index 04e4ec99..e73071b9 100644 --- a/x/bet/keeper/msg_server_bet.go +++ b/x/bet/keeper/msg_server_bet.go @@ -33,7 +33,7 @@ func (k msgServer) Wager( bet := types.NewBet(msg.Creator, msg.Props, payload.SelectedOdds, payload.Meta) if err := k.Keeper.Wager(ctx, bet, payload.OddsMap()); err != nil { - return nil, sdkerrors.Wrapf(types.ErrInWager, "%s", err) + return nil, err } msg.EmitEvent(&ctx) diff --git a/x/bet/keeper/wager.go b/x/bet/keeper/wager.go index 1d18fe5a..a01f6645 100644 --- a/x/bet/keeper/wager.go +++ b/x/bet/keeper/wager.go @@ -60,7 +60,7 @@ func (k Keeper) Wager(ctx sdk.Context, bet *types.Bet, betOdds map[string]*types bettorAddress, bet.Fee, bet.OddsValue, betID, betOdds, market.OddsUIDS(), ) if err != nil { - return sdkerrors.Wrapf(types.ErrInOBWagerProcessing, "%s", err) + return err } // set bet as placed