From 6f6138f02a84aea143f23648f893bb6c52da9406 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Wed, 10 Jan 2024 17:57:23 +0530 Subject: [PATCH] Resolve rebase conflicts --- x/registry/keeper/grpc_query_test.go | 9 +++------ x/registry/keeper/keeper.go | 4 ++++ x/registry/keeper/naming_keeper.go | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/x/registry/keeper/grpc_query_test.go b/x/registry/keeper/grpc_query_test.go index 6e9ed916..f22c31a5 100644 --- a/x/registry/keeper/grpc_query_test.go +++ b/x/registry/keeper/grpc_query_test.go @@ -87,8 +87,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { { Key: "tags", Value: ®istrytypes.QueryListRecordsRequest_ValueInput{ - Type: "string", - String_: "tagA", + Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"tagA"}, }, }, }, @@ -105,8 +104,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { { Key: "tags", Value: ®istrytypes.QueryListRecordsRequest_ValueInput{ - Type: "string", - String_: "NOEXIST", + Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"NOEXIST"}, }, }, }, @@ -123,8 +121,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { { Key: "typ", Value: ®istrytypes.QueryListRecordsRequest_ValueInput{ - Type: "string", - String_: "eWebsiteRegistrationRecord", + Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"eWebsiteRegistrationRecord"}, }, }, }, diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index a47ce572..9fdae8c0 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -106,6 +106,10 @@ func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeep // Logger returns a module-specific logger. func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return logger(ctx) +} + +func logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", types.ModuleName) } diff --git a/x/registry/keeper/naming_keeper.go b/x/registry/keeper/naming_keeper.go index 017bbd20..44946e61 100644 --- a/x/registry/keeper/naming_keeper.go +++ b/x/registry/keeper/naming_keeper.go @@ -611,7 +611,7 @@ func (k Keeper) ProcessAuthorityExpiryQueue(ctx sdk.Context) { k.SetNameAuthority(ctx, name, &authority) k.DeleteAuthorityExpiryQueue(ctx, name, authority) - logger(ctx).Info(fmt.Sprintf("Marking authority expired as no bond present: %s", name)) + k.Logger(ctx).Info(fmt.Sprintf("Marking authority expired as no bond present: %s", name)) return } @@ -672,7 +672,7 @@ func (k Keeper) AuthorityExpiryQueueIterator(ctx sdk.Context, endTime time.Time) // TryTakeAuthorityRent tries to take rent from the authority bond. func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority types.NameAuthority) { - logger(ctx).Info(fmt.Sprintf("Trying to take rent for authority: %s", name)) + k.Logger(ctx).Info(fmt.Sprintf("Trying to take rent for authority: %s", name)) params := k.GetParams(ctx) rent := params.AuthorityRent @@ -684,7 +684,7 @@ func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority typ k.SetNameAuthority(ctx, name, &authority) k.DeleteAuthorityExpiryQueue(ctx, name, authority) - logger(ctx).Info(fmt.Sprintf("Insufficient funds in owner account to pay authority rent, marking as expired: %s", name)) + k.Logger(ctx).Info(fmt.Sprintf("Insufficient funds in owner account to pay authority rent, marking as expired: %s", name)) return } @@ -699,7 +699,7 @@ func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority typ k.SetNameAuthority(ctx, name, &authority) k.AddBondToAuthorityIndexEntry(ctx, authority.BondId, name) - logger(ctx).Info(fmt.Sprintf("Authority rent paid successfully: %s", name)) + k.Logger(ctx).Info(fmt.Sprintf("Authority rent paid successfully: %s", name)) } // ListNameAuthorityRecords - get all name authority records.