[#5] morph/client: Use generic LRU cache

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2022-12-30 12:47:18 +03:00 committed by fyrchik
parent d8fb9c85eb
commit 55b403e0ee
5 changed files with 9 additions and 5 deletions

View file

@ -8,7 +8,7 @@ import (
"time"
"github.com/TrueCloudLab/frostfs-node/pkg/util/logger"
lru "github.com/hashicorp/golang-lru"
lru "github.com/hashicorp/golang-lru/v2"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/rpcclient"
@ -185,7 +185,7 @@ func newActor(ws *rpcclient.WSClient, acc *wallet.Account, cfg cfg) (*actor.Acto
}
func newClientCache() cache {
c, _ := lru.New(100) // returns error only if size is negative
c, _ := lru.New[util.Uint256, uint32](100) // returns error only if size is negative
return cache{
m: &sync.RWMutex{},
txHeights: c,