From a506e0debdd43444bca436a7f1d1540379f44be8 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Wed, 29 Nov 2023 12:34:07 +0200 Subject: [PATCH] - integrated new libs --- go.mod | 4 ++-- go.sum | 8 ++++---- lrucache/lrucache_test.go | 4 ++-- storageUnit/nilStorer.go | 4 ++-- storageUnit/storageunit.go | 8 ++++---- types/interface.go | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index cfbd8445..08fa68f5 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ go 1.20 require ( github.com/hashicorp/golang-lru v0.6.0 github.com/multiversx/concurrent-map v0.1.4 - github.com/multiversx/mx-chain-core-go v1.2.16 - github.com/multiversx/mx-chain-logger-go v1.0.13 + github.com/multiversx/mx-chain-core-go v1.2.19-0.20231129100534-356aa234f4ff + github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231129101244-c44fa1c79b03 github.com/stretchr/testify v1.7.2 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d ) diff --git a/go.sum b/go.sum index d93b610d..42421fb2 100644 --- a/go.sum +++ b/go.sum @@ -41,10 +41,10 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUYwbO0993uPI= github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o= -github.com/multiversx/mx-chain-core-go v1.2.16 h1:m0hUNmZQjGJxKDLQOHoM9jSaeDfVTbyd+mqiS8+NckE= -github.com/multiversx/mx-chain-core-go v1.2.16/go.mod h1:BILOGHUOIG5dNNX8cgkzCNfDaVtoYrJRYcPnpxRMH84= -github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpAXmqjT02klNT/JnY= -github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk= +github.com/multiversx/mx-chain-core-go v1.2.19-0.20231129100534-356aa234f4ff h1:Iss44e+2C4vGtQ5sU3lOqDQ+dxvwlO+Z3mSbC8T1J64= +github.com/multiversx/mx-chain-core-go v1.2.19-0.20231129100534-356aa234f4ff/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE= +github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231129101244-c44fa1c79b03 h1:krjJTyN9jrFTK0goMGFdgvJGy6bYSqe8EtI/HCceUmU= +github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231129101244-c44fa1c79b03/go.mod h1:fH/fR/GEBsDjPkBoZDVJMoYo2HhlA7++DP6QfITJ1N8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= diff --git a/lrucache/lrucache_test.go b/lrucache/lrucache_test.go index 874fe357..4913bf3d 100644 --- a/lrucache/lrucache_test.go +++ b/lrucache/lrucache_test.go @@ -8,9 +8,9 @@ import ( "time" "github.com/multiversx/mx-chain-core-go/core/check" - "github.com/multiversx/mx-chain-core-go/storage" "github.com/multiversx/mx-chain-storage-go/common" "github.com/multiversx/mx-chain-storage-go/lrucache" + "github.com/multiversx/mx-chain-storage-go/types" "github.com/stretchr/testify/assert" ) @@ -421,7 +421,7 @@ func TestLRUCache_CloseShouldNotErr(t *testing.T) { } type cacheWrapper struct { - c storage.Cacher + c types.Cacher } func newCacheWrapper() *cacheWrapper { diff --git a/storageUnit/nilStorer.go b/storageUnit/nilStorer.go index 224393f9..2330b452 100644 --- a/storageUnit/nilStorer.go +++ b/storageUnit/nilStorer.go @@ -1,7 +1,7 @@ package storageUnit import ( - storageCore "github.com/multiversx/mx-chain-core-go/storage" + "github.com/multiversx/mx-chain-core-go/data" "github.com/multiversx/mx-chain-storage-go/common" ) @@ -20,7 +20,7 @@ func (ns *NilStorer) GetFromEpoch(_ []byte, _ uint32) ([]byte, error) { } // GetBulkFromEpoch will do nothing -func (ns *NilStorer) GetBulkFromEpoch(_ [][]byte, _ uint32) ([]storageCore.KeyValuePair, error) { +func (ns *NilStorer) GetBulkFromEpoch(_ [][]byte, _ uint32) ([]data.KeyValuePair, error) { return nil, nil } diff --git a/storageUnit/storageunit.go b/storageUnit/storageunit.go index a560f252..7f721075 100644 --- a/storageUnit/storageunit.go +++ b/storageUnit/storageunit.go @@ -8,11 +8,11 @@ import ( "time" "github.com/multiversx/mx-chain-core-go/core/check" + "github.com/multiversx/mx-chain-core-go/data" "github.com/multiversx/mx-chain-core-go/hashing" "github.com/multiversx/mx-chain-core-go/hashing/blake2b" "github.com/multiversx/mx-chain-core-go/hashing/fnv" "github.com/multiversx/mx-chain-core-go/hashing/keccak" - storageCore "github.com/multiversx/mx-chain-core-go/storage" logger "github.com/multiversx/mx-chain-logger-go" "github.com/multiversx/mx-chain-storage-go/common" "github.com/multiversx/mx-chain-storage-go/fifocache" @@ -200,8 +200,8 @@ func (u *Unit) GetFromEpoch(key []byte, _ uint32) ([]byte, error) { } // GetBulkFromEpoch will call the Get method for all keys as this storer doesn't handle epochs -func (u *Unit) GetBulkFromEpoch(keys [][]byte, _ uint32) ([]storageCore.KeyValuePair, error) { - results := make([]storageCore.KeyValuePair, 0, len(keys)) +func (u *Unit) GetBulkFromEpoch(keys [][]byte, _ uint32) ([]data.KeyValuePair, error) { + results := make([]data.KeyValuePair, 0, len(keys)) for _, key := range keys { value, err := u.Get(key) if err != nil { @@ -211,7 +211,7 @@ func (u *Unit) GetBulkFromEpoch(keys [][]byte, _ uint32) ([]storageCore.KeyValue ) continue } - keyValue := storageCore.KeyValuePair{Key: key, Value: value} + keyValue := data.KeyValuePair{Key: key, Value: value} results = append(results, keyValue) } return results, nil diff --git a/types/interface.go b/types/interface.go index 99dca5f4..0159e6f6 100644 --- a/types/interface.go +++ b/types/interface.go @@ -3,7 +3,7 @@ package types import ( "time" - "github.com/multiversx/mx-chain-core-go/storage" + "github.com/multiversx/mx-chain-core-go/data" ) // Persister provides storage of data services in a database like construct @@ -94,7 +94,7 @@ type Storer interface { ClearCache() DestroyUnit() error GetFromEpoch(key []byte, epoch uint32) ([]byte, error) - GetBulkFromEpoch(keys [][]byte, epoch uint32) ([]storage.KeyValuePair, error) + GetBulkFromEpoch(keys [][]byte, epoch uint32) ([]data.KeyValuePair, error) GetOldestEpoch() (uint32, error) RangeKeys(handler func(key []byte, val []byte) bool) Close() error