Skip to content

Commit

Permalink
modify error case
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed Feb 6, 2023
1 parent a7557b1 commit 85cf38b
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 85cf38b

Please sign in to comment.