Index multivalued attributes.
Some checks failed
Build / cleanup-runs (pull_request) Failing after 3s
Deploy Contract / cleanup-runs (pull_request) Failing after 3s
Deploy Contract / deploy (pull_request) Failing after 24s
Dependency Review / dependency-review (pull_request) Failing after 42s
Pull Request Labeler / triage (pull_request) Successful in 12s
Build / build (pull_request) Failing after 1m11s
Lint / Run flake8 on python integration tests (pull_request) Failing after 38s
Lint / Run golangci-lint (pull_request) Failing after 41s
Run Gosec / Gosec (pull_request) Failing after 18s
Tests / cleanup-runs (pull_request) Failing after 11s
Semgrep / Scan (pull_request) Failing after 13s
Tests / test-importer (pull_request) Failing after 53s
Tests / test-rpc (pull_request) Failing after 51s
Tests / test-unit-cover (pull_request) Failing after 1m1s
Tests / sdk_tests (pull_request) Failing after 1m45s
CodeQL / Analyze (go) (pull_request) Failing after 4m19s
Some checks failed
Build / cleanup-runs (pull_request) Failing after 3s
Deploy Contract / cleanup-runs (pull_request) Failing after 3s
Deploy Contract / deploy (pull_request) Failing after 24s
Dependency Review / dependency-review (pull_request) Failing after 42s
Pull Request Labeler / triage (pull_request) Successful in 12s
Build / build (pull_request) Failing after 1m11s
Lint / Run flake8 on python integration tests (pull_request) Failing after 38s
Lint / Run golangci-lint (pull_request) Failing after 41s
Run Gosec / Gosec (pull_request) Failing after 18s
Tests / cleanup-runs (pull_request) Failing after 11s
Semgrep / Scan (pull_request) Failing after 13s
Tests / test-importer (pull_request) Failing after 53s
Tests / test-rpc (pull_request) Failing after 51s
Tests / test-unit-cover (pull_request) Failing after 1m1s
Tests / sdk_tests (pull_request) Failing after 1m45s
CodeQL / Analyze (go) (pull_request) Failing after 4m19s
This commit is contained in:
parent
588c52c0b2
commit
58789fbf62
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
@ -349,9 +350,24 @@ func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) erro
|
||||
{
|
||||
// #nosec G705
|
||||
for key := range record.Attributes {
|
||||
indexKey := GetAttributesIndexKey(key, record.Attributes[key])
|
||||
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||
return err
|
||||
attr := record.Attributes[key]
|
||||
rt := reflect.TypeOf(attr)
|
||||
switch rt.Kind() {
|
||||
case reflect.Slice:
|
||||
av := attr.([]interface{})
|
||||
for i := range av {
|
||||
indexKey := GetAttributesIndexKey(key, av[i])
|
||||
k.Logger(ctx).Error(fmt.Sprintf("attr indexKey: %s", indexKey))
|
||||
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
default:
|
||||
indexKey := GetAttributesIndexKey(key, attr)
|
||||
k.Logger(ctx).Error(fmt.Sprintf("attr indexKey: %s", indexKey))
|
||||
if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user