laconicd-deprecated/x/feemarket/keeper/msg_server_test.go
Vladislav Varadinov 57ed355c98
chore(feemarket) - Depreacte usage of x/params in x/feemarket (#1509)
* (refactor): Added new MsgUpdateParams tx and generated new proto files

* (refactor): Refactor for migration of x/params

* (fix): Refactor to use single Params store key for easier more readable code

* (fix): removed unused

* (fix): add validation

* (fix): fix linter

* remove line

* Added changes from code review

* Apply changes from code review

* (fix): Made ParamKey back to a string

* Added CHANGELOG entry

* Apply suggestions from code review

Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>

* (fix): remove HTTP endpoint exposure

* Apply suggestions from code review

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* fix: Apply changes from code review and run linter

* Update x/feemarket/keeper/params.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update x/feemarket/types/msg.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* tests: added tests for msg_server and msg

* tests: add failing test for migration

* Update x/feemarket/keeper/params.go

Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2023-01-05 17:59:46 +01:00

41 lines
952 B
Go

package keeper_test
import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/evmos/ethermint/x/feemarket/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)
}
})
}
}