Remove hard-coded record types #132
@ -87,8 +87,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
{
|
{
|
||||||
Key: "tags",
|
Key: "tags",
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
Type: "string",
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"tagA"},
|
||||||
String_: "tagA",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -105,8 +104,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
{
|
{
|
||||||
Key: "tags",
|
Key: "tags",
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
Type: "string",
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"NOEXIST"},
|
||||||
String_: "NOEXIST",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -123,8 +121,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
{
|
{
|
||||||
Key: "typ",
|
Key: "typ",
|
||||||
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput{
|
||||||
Type: "string",
|
Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"eWebsiteRegistrationRecord"},
|
||||||
String_: "eWebsiteRegistrationRecord",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -106,6 +106,10 @@ func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeep
|
|||||||
|
|
||||||
// Logger returns a module-specific logger.
|
// Logger returns a module-specific logger.
|
||||||
func (k Keeper) Logger(ctx sdk.Context) log.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)
|
return ctx.Logger().With("module", types.ModuleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ func (k Keeper) ProcessAuthorityExpiryQueue(ctx sdk.Context) {
|
|||||||
k.SetNameAuthority(ctx, name, &authority)
|
k.SetNameAuthority(ctx, name, &authority)
|
||||||
k.DeleteAuthorityExpiryQueue(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
|
return
|
||||||
}
|
}
|
||||||
@ -672,7 +672,7 @@ func (k Keeper) AuthorityExpiryQueueIterator(ctx sdk.Context, endTime time.Time)
|
|||||||
|
|
||||||
// TryTakeAuthorityRent tries to take rent from the authority bond.
|
// TryTakeAuthorityRent tries to take rent from the authority bond.
|
||||||
func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority types.NameAuthority) {
|
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)
|
params := k.GetParams(ctx)
|
||||||
rent := params.AuthorityRent
|
rent := params.AuthorityRent
|
||||||
@ -684,7 +684,7 @@ func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority typ
|
|||||||
k.SetNameAuthority(ctx, name, &authority)
|
k.SetNameAuthority(ctx, name, &authority)
|
||||||
k.DeleteAuthorityExpiryQueue(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
|
return
|
||||||
}
|
}
|
||||||
@ -699,7 +699,7 @@ func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority typ
|
|||||||
k.SetNameAuthority(ctx, name, &authority)
|
k.SetNameAuthority(ctx, name, &authority)
|
||||||
k.AddBondToAuthorityIndexEntry(ctx, authority.BondId, name)
|
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.
|
// ListNameAuthorityRecords - get all name authority records.
|
||||||
|
Loading…
Reference in New Issue
Block a user