Skip to content

Commit

Permalink
Change name of ContractConfigured to IsContractConfigured.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Witkowski committed Oct 31, 2023
1 parent 9e437e4 commit d9060c8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions x/ibcratelimit/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions x/ibcratelimit/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (s *TestSuite) TestGetContractAddress() {
}
}

func (s *TestSuite) TestContractConfigured() {
func (s *TestSuite) TestIsContractConfigured() {
tests := []struct {
name string
contract string
Expand All @@ -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")
})
}
Expand Down
2 changes: 1 addition & 1 deletion x/ibcratelimit/keeper/rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions x/ibcratelimit/module/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit d9060c8

Please sign in to comment.