Skip to content

Commit

Permalink
return err on set params
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Sep 16, 2024
1 parent 71477cc commit 81f6303
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion x/ibc-rate-limit/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
// InitGenesis initializes the x/ibc-rate-limit module's state from a provided genesis
// state, which includes the parameter for the contract address.
func (i *ICS4Wrapper) InitGenesis(ctx sdk.Context, genState types.GenesisState) {
i.SetParams(ctx, genState.Params)
err := i.IbcratelimitKeeper.SetParams(ctx, genState.Params)
if err != nil {
panic(err)
}
}

// ExportGenesis returns the x/ibc-rate-limit module's exported genesis.
Expand Down
2 changes: 1 addition & 1 deletion x/ibc-rate-limit/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ func (suite *MiddlewareTestSuite) InstantiateRLContract(quotas string) sdk.AccAd
func (suite *MiddlewareTestSuite) RegisterRateLimitingContract(addr []byte) {
addrStr, _ := sdk.Bech32ifyAddressBytes("neutron", addr)
app := suite.GetNeutronZoneApp(suite.ChainA)
_ = app.RateLimitingICS4Wrapper.IbcratelimitKeeper.SetParams(suite.ChainA.GetContext(), types.Params{ContractAddress: addrStr})
_ = app.RateLimitingICS4Wrapper.SetParams(suite.ChainA.GetContext(), types.Params{ContractAddress: addrStr})
require.True(suite.ChainA.TB, true)
}

Expand Down
4 changes: 2 additions & 2 deletions x/ibc-rate-limit/ics4_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ func (i *ICS4Wrapper) GetParams(ctx sdk.Context) (params types.Params) {
return params
}

func (i *ICS4Wrapper) SetParams(ctx sdk.Context, params types.Params) {
i.IbcratelimitKeeper.SetParams(ctx, params)
func (i *ICS4Wrapper) SetParams(ctx sdk.Context, params types.Params) error {
return i.IbcratelimitKeeper.SetParams(ctx, params)
}

0 comments on commit 81f6303

Please sign in to comment.