diff --git a/x/ibcratelimit/keeper/keeper.go b/x/ibcratelimit/keeper/keeper.go index 640f266ded..b9f7d22174 100644 --- a/x/ibcratelimit/keeper/keeper.go +++ b/x/ibcratelimit/keeper/keeper.go @@ -60,8 +60,8 @@ func (k Keeper) GetContractAddress(ctx sdk.Context) (contract string) { return params.ContractAddress } -// ContractConfigured Checks if the contract has been configured for the module. -func (k Keeper) ContractConfigured(ctx sdk.Context) bool { +// IsContractConfigured Checks if the contract has been configured for the module. +func (k Keeper) IsContractConfigured(ctx sdk.Context) bool { params, err := k.GetParams(ctx) if err != nil { return false diff --git a/x/ibcratelimit/keeper/keeper_test.go b/x/ibcratelimit/keeper/keeper_test.go index f5c888ba67..25b37711e5 100644 --- a/x/ibcratelimit/keeper/keeper_test.go +++ b/x/ibcratelimit/keeper/keeper_test.go @@ -84,7 +84,7 @@ func (s *TestSuite) TestGetContractAddress() { } } -func (s *TestSuite) TestContractConfigured() { +func (s *TestSuite) TestIsContractConfigured() { tests := []struct { name string contract string @@ -105,7 +105,7 @@ func (s *TestSuite) TestContractConfigured() { s.Run(tc.name, func() { params := ibcratelimit.NewParams(tc.contract) s.app.RateLimitingKeeper.SetParams(s.ctx, params) - configured := s.app.RateLimitingKeeper.ContractConfigured(s.ctx) + configured := s.app.RateLimitingKeeper.IsContractConfigured(s.ctx) s.Assert().Equal(tc.expected, configured, "should have expected configured output") }) } diff --git a/x/ibcratelimit/keeper/rate_limit.go b/x/ibcratelimit/keeper/rate_limit.go index b29a4119dd..14f2ab448f 100644 --- a/x/ibcratelimit/keeper/rate_limit.go +++ b/x/ibcratelimit/keeper/rate_limit.go @@ -94,7 +94,7 @@ func (k Keeper) RevertSentPacket( ctx sdk.Context, packet exported.PacketI, ) error { - if !k.ContractConfigured(ctx) { + if !k.IsContractConfigured(ctx) { return nil } diff --git a/x/ibcratelimit/module/ibc_middleware.go b/x/ibcratelimit/module/ibc_middleware.go index 9e4e06d460..e6127fae85 100644 --- a/x/ibcratelimit/module/ibc_middleware.go +++ b/x/ibcratelimit/module/ibc_middleware.go @@ -134,7 +134,7 @@ func (im *IBCMiddleware) OnRecvPacket( return ibc.NewEmitErrorAcknowledgement(ctx, ibcratelimit.ErrBadMessage, err.Error()) } - if !im.keeper.ContractConfigured(ctx) { + if !im.keeper.IsContractConfigured(ctx) { // The contract has not been configured. Continue as usual return im.app.OnRecvPacket(ctx, packet, relayer) } @@ -210,7 +210,7 @@ func (im *IBCMiddleware) SendPacket( timeoutTimestamp uint64, data []byte, ) (sequence uint64, err error) { - if !im.keeper.ContractConfigured(ctx) { + if !im.keeper.IsContractConfigured(ctx) { // The contract has not been configured. Continue as usual return im.channel.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) }