fix lint errors
This commit is contained in:
parent
948f11d60c
commit
b57b2b8ede
@ -296,16 +296,17 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
|
|||||||
switch record.Attributes["type"] {
|
switch record.Attributes["type"] {
|
||||||
case "ServiceProviderRegistration":
|
case "ServiceProviderRegistration":
|
||||||
{
|
{
|
||||||
for key, val := range record.Attributes {
|
for key := range record.Attributes {
|
||||||
if key == "x500" {
|
if key == "x500" {
|
||||||
for x500Key, x500Val := range val.(map[string]string) {
|
// #nosec G705
|
||||||
|
for x500Key, x500Val := range record.Attributes[key].(map[string]string) {
|
||||||
indexKey := GetAttributesIndexKey(fmt.Sprintf("x500%s", x500Key), x500Val)
|
indexKey := GetAttributesIndexKey(fmt.Sprintf("x500%s", x500Key), x500Val)
|
||||||
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
indexKey := GetAttributesIndexKey(key, val)
|
indexKey := GetAttributesIndexKey(key, record.Attributes[key])
|
||||||
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -314,8 +315,8 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
|
|||||||
}
|
}
|
||||||
case "WebsiteRegistrationRecord":
|
case "WebsiteRegistrationRecord":
|
||||||
{
|
{
|
||||||
for key, val := range record.Attributes {
|
for key := range record.Attributes {
|
||||||
indexKey := GetAttributesIndexKey(key, val)
|
indexKey := GetAttributesIndexKey(key, record.Attributes[key])
|
||||||
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user