Skip to content

Commit

Permalink
modify error case (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 authored Feb 6, 2023
1 parent a7557b1 commit 471a4d7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions x/bankplus/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/stretchr/testify/suite"

sdkerrors "github.com/line/lbm-sdk/types/errors"
ocproto "github.com/line/ostracon/proto/ostracon/types"

"github.com/line/lbm-sdk/simapp"
Expand Down Expand Up @@ -281,22 +282,23 @@ func (suite *IntegrationTestSuite) TestInputOutputCoins() {
}
tcs := map[string]struct {
deactMultiSend bool
err error
}{
"MultiSend Off": {
true,
sdkerrors.ErrNotSupported.Wrap("MultiSend was deactivated"),
},
"MultiSend On": {
false,
nil,
},
}

for name, tc := range tcs {
tc := tc
suite.T().Run(name, func(t *testing.T) {
if tc.deactMultiSend {
suite.Panics(func() {
_ = targetKeeper(tc.deactMultiSend).InputOutputCoins(ctx, input, output)
})
if tc.err != nil {
suite.EqualError(targetKeeper(tc.deactMultiSend).InputOutputCoins(ctx, input, output), tc.err.Error())
} else {
err := targetKeeper(tc.deactMultiSend).InputOutputCoins(ctx, input, output)
suite.Assert().NoError(err)
Expand Down

0 comments on commit 471a4d7

Please sign in to comment.