From 1c627e0d0de9c4baa8fe4b2c03d9ad19abdd990e Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Wed, 18 Sep 2024 12:32:39 +0200 Subject: [PATCH] Revert "vochain/indexer: drop x/exp/maps for maps" This reverts commit e65c7cae0b3953c652225e5a4f3f01defc0489d5. since we downgraded go back to 1.22 --- go.mod | 2 +- vochain/indexer/indexer.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 570cc8932..0450206f8 100644 --- a/go.mod +++ b/go.mod @@ -57,6 +57,7 @@ require ( go.mongodb.org/mongo-driver v1.12.1 go.vocdoni.io/proto v1.15.10-0.20240903073233-86144b1e2165 golang.org/x/crypto v0.26.0 + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa golang.org/x/net v0.28.0 google.golang.org/protobuf v1.34.2 lukechampine.com/blake3 v1.3.0 @@ -326,7 +327,6 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect diff --git a/vochain/indexer/indexer.go b/vochain/indexer/indexer.go index 37fea31a2..c4d7a6441 100644 --- a/vochain/indexer/indexer.go +++ b/vochain/indexer/indexer.go @@ -9,7 +9,6 @@ import ( "errors" "fmt" "io" - "maps" "math/big" "os" "path/filepath" @@ -30,6 +29,7 @@ import ( "go.vocdoni.io/proto/build/go/models" "github.com/pressly/goose/v3" + "golang.org/x/exp/maps" // modernc is a pure-Go version, but its errors have less useful info. // We use mattn while developing and testing, and we can swap them later. @@ -524,7 +524,8 @@ func (idx *Indexer) Commit(height uint32) error { defer idx.blockMu.Unlock() // Update existing processes - updateProcs := slices.Sorted(maps.Keys(idx.blockUpdateProcs)) + updateProcs := maps.Keys(idx.blockUpdateProcs) + slices.Sort(updateProcs) queries := idx.blockTxQueries() ctx := context.TODO()