laconicd-deprecated/x/feemarket/keeper/msg_server_test.go
2023-03-13 12:34:10 +05:30

41 lines
953 B
Go

package keeper_test
import (
"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)
}
})
}
}