@@ -2,7 +2,6 @@ package dataRetriever
22
33import (
44 "fmt"
5- "os"
65 "time"
76
87 "github.com/multiversx/mx-chain-core-go/marshal"
@@ -15,8 +14,8 @@ import (
1514 "github.com/multiversx/mx-chain-go/dataRetriever/shardedData"
1615 "github.com/multiversx/mx-chain-go/dataRetriever/txpool"
1716 "github.com/multiversx/mx-chain-go/storage/cache"
18- storageFactory "github.com/multiversx/mx-chain-go/storage/factory"
1917 "github.com/multiversx/mx-chain-go/storage/storageunit"
18+ "github.com/multiversx/mx-chain-go/testscommon"
2019 "github.com/multiversx/mx-chain-go/testscommon/txcachemocks"
2120 "github.com/multiversx/mx-chain-go/trie/factory"
2221)
@@ -84,32 +83,18 @@ func createPoolHolderArgs(numShards uint32, selfShard uint32) dataPool.DataPoolA
8483
8584 cacherConfig = storageunit.CacheConfig {Capacity : 50000 , Type : storageunit .LRUCache }
8685 cacher , err := cache .NewCapacityLRU (10 , 10000 )
87- panicIfError ("Create trieSync cacher" , err )
88-
89- tempDir , _ := os .MkdirTemp ("" , "integrationTests" )
90-
91- dbConfig := config.DBConfig {
92- FilePath : tempDir ,
93- Type : string (storageunit .LvlDBSerial ),
94- BatchDelaySeconds : 4 ,
95- MaxBatchSize : 10000 ,
96- MaxOpenFiles : 10 ,
97- }
98-
99- persisterFactory , err := storageFactory .NewPersisterFactory (dbConfig )
100- panicIfError ("Create persister factory" , err )
86+ panicIfError ("CreatePoolsHolder" , err )
10187
102- persister , err := persisterFactory .CreateWithRetries (tempDir )
103- panicIfError ("Create trieSync DB" , err )
88+ db := testscommon .NewMemDbMock ()
10489 tnf := factory .NewTrieNodeFactory ()
10590
10691 adaptedTrieNodesStorage , err := storageunit .NewStorageCacherAdapter (
10792 cacher ,
108- persister ,
93+ db ,
10994 tnf ,
11095 & marshal.GogoProtoMarshalizer {},
11196 )
112- panicIfError ("Create AdaptedTrieNodesStorage " , err )
97+ panicIfError ("CreatePoolsHolder " , err )
11398
11499 trieNodesChunks , err := storageunit .NewCache (cacherConfig )
115100 panicIfError ("CreatePoolsHolder" , err )
0 commit comments