-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4987c3a
commit 97dcf3e
Showing
10 changed files
with
213 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/x/bank/types" | ||
) | ||
|
||
func (suite *IntegrationTestSuite) TestMsgUpdateParams() { | ||
// default params | ||
params := types.DefaultParams() | ||
|
||
testCases := []struct { | ||
name string | ||
input *types.MsgUpdateParams | ||
expErr bool | ||
expErrMsg string | ||
}{ | ||
{ | ||
name: "invalid authority", | ||
input: &types.MsgUpdateParams{ | ||
Authority: "invalid", | ||
Params: params, | ||
}, | ||
expErr: true, | ||
expErrMsg: "invalid authority", | ||
}, | ||
{ | ||
name: "send enabled param", | ||
input: &types.MsgUpdateParams{ | ||
Authority: suite.app.BankKeeper.GetAuthority(), | ||
Params: types.Params{ | ||
SendEnabled: []*types.SendEnabled{ | ||
{Denom: "foo", Enabled: true}, | ||
}, | ||
}, | ||
}, | ||
expErr: true, | ||
expErrMsg: "use of send_enabled in params is no longer supported", | ||
}, | ||
{ | ||
name: "all good", | ||
input: &types.MsgUpdateParams{ | ||
Authority: suite.app.BankKeeper.GetAuthority(), | ||
Params: params, | ||
}, | ||
expErr: false, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
tc := tc | ||
suite.Run(tc.name, func() { | ||
_, err := suite.msgServer.UpdateParams(suite.ctx, tc.input) | ||
|
||
if tc.expErr { | ||
suite.Require().Error(err) | ||
suite.Require().Contains(err.Error(), tc.expErrMsg) | ||
} else { | ||
suite.Require().NoError(err) | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.