laconicd-deprecated/x/feemarket/keeper/msg_server_test.go

41 lines
953 B
Go
Raw Normal View History

package keeper_test
import (
2023-03-13 07:04:10 +00:00
"github.com/cerc-io/laconicd/x/feemarket/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
)
func (suite *KeeperTestSuite) TestUpdateParams() {
testCases := []struct {
name string
request *types.MsgUpdateParams
expectErr bool
}{
{
name: "fail - invalid authority",
request: &types.MsgUpdateParams{Authority: "foobar"},
expectErr: true,
},
{
name: "pass - valid Update msg",
request: &types.MsgUpdateParams{
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
Params: types.DefaultParams(),
},
expectErr: false,
},
}
for _, tc := range testCases {
suite.Run("MsgUpdateParams", func() {
_, err := suite.app.FeeMarketKeeper.UpdateParams(suite.ctx, tc.request)
if tc.expectErr {
suite.Require().Error(err)
} else {
suite.Require().NoError(err)
}
})
}
}