Remove hard-coded record types #132

Merged
ashwin merged 17 commits from deep-stack/laconicd:ng-rm-record-types into main 2024-01-15 04:20:39 +00:00
3 changed files with 11 additions and 10 deletions
Showing only changes of commit 6f6138f02a - Show all commits

View File

@ -87,8 +87,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
{
Key: "tags",
Value: &registrytypes.QueryListRecordsRequest_ValueInput{
Type: "string",
String_: "tagA",
Value: &registrytypes.QueryListRecordsRequest_ValueInput_String_{"tagA"},
},
},
},
@ -105,8 +104,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
{
Key: "tags",
Value: &registrytypes.QueryListRecordsRequest_ValueInput{
Type: "string",
String_: "NOEXIST",
Value: &registrytypes.QueryListRecordsRequest_ValueInput_String_{"NOEXIST"},
},
},
},
@ -123,8 +121,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
{
Key: "typ",
Value: &registrytypes.QueryListRecordsRequest_ValueInput{
Type: "string",
String_: "eWebsiteRegistrationRecord",
Value: &registrytypes.QueryListRecordsRequest_ValueInput_String_{"eWebsiteRegistrationRecord"},
},
},
},

View File

@ -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)
}

View File

@ -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.