Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
fix return format
Browse files Browse the repository at this point in the history
  • Loading branch information
taryune committed Dec 13, 2023
1 parent 2790c83 commit f0ae30d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/resolver/keeper/query_all_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (k Keeper) AllRecords(goCtx context.Context, req *types.QueryAllRecordsRequ
values := make(map[string]*registrytypes.Record)
for _, record := range secondLevelDomain.Records {
key := generateRecordKey(record)
if key == "" {
if key != "" {
values[key] = record
}
}
Expand All @@ -42,11 +42,11 @@ func (k Keeper) AllRecords(goCtx context.Context, req *types.QueryAllRecordsRequ
func generateRecordKey(record *registrytypes.Record) string {
switch {
case record.GetDnsRecord() != nil:
return string(record.GetDnsRecord().DnsRecordType)
return record.GetDnsRecord().DnsRecordType.String()
case record.GetWalletRecord() != nil:
return string(record.GetWalletRecord().WalletRecordType)
return record.GetWalletRecord().WalletRecordType.String()
case record.GetMetadata() != nil:
return string(record.GetMetadata().Key)
return record.GetMetadata().Key
default:
return ""
}
Expand Down

0 comments on commit f0ae30d

Please sign in to comment.