Skip to content

Commit a52c1e4

Browse files
committed
expose merkledb.NewConfig
Signed-off-by: Joshua Kim <[email protected]>
1 parent a03272f commit a52c1e4

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

x/merkledb/history_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ func Test_History_Large(t *testing.T) {
9191
// History must be large enough to get the change proof
9292
// after this loop.
9393
config.HistoryLength = uint(numIters)
94-
db, err := New(
95-
context.Background(),
96-
memdb.New(),
97-
config,
98-
)
94+
db, err := New(context.Background(), memdb.New(), config, "")
9995
require.NoError(err)
10096
roots := []ids.ID{}
10197

x/merkledb/metrics_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ func Test_Metrics_Basic_Usage(t *testing.T) {
5151
}
5252

5353
func Test_Metrics_Initialize(t *testing.T) {
54-
db, err := New(
55-
context.Background(),
56-
memdb.New(),
57-
newDefaultConfig(),
58-
)
54+
db, err := New(context.Background(), memdb.New(), newDefaultConfig(), "")
5955
require.NoError(t, err)
6056

6157
require.NoError(t, db.Put([]byte("key"), []byte("value")))

x/merkledb/trie_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,11 +914,7 @@ func Test_Trie_MultipleStates(t *testing.T) {
914914
randCount++
915915
rdb := memdb.New()
916916
defer rdb.Close()
917-
db, err := New(
918-
context.Background(),
919-
rdb,
920-
newDefaultConfig(),
921-
)
917+
db, err := New(context.Background(), rdb, newDefaultConfig(), "")
922918
require.NoError(err)
923919
defer db.Close()
924920

x/sync/network_server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func Test_Server_GetChangeProof(t *testing.T) {
160160
context.Background(),
161161
memdb.New(),
162162
newDefaultDBConfig(),
163+
"",
163164
)
164165
require.NoError(t, err)
165166
startRoot, err := serverDB.GetMerkleRoot(context.Background())

x/sync/sync_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func Test_Creation(t *testing.T) {
3333
context.Background(),
3434
memdb.New(),
3535
newDefaultDBConfig(),
36+
"",
3637
)
3738
require.NoError(err)
3839

@@ -56,6 +57,7 @@ func Test_Completion(t *testing.T) {
5657
context.Background(),
5758
memdb.New(),
5859
newDefaultDBConfig(),
60+
"",
5961
)
6062
require.NoError(err)
6163

@@ -66,6 +68,7 @@ func Test_Completion(t *testing.T) {
6668
context.Background(),
6769
memdb.New(),
6870
newDefaultDBConfig(),
71+
"",
6972
)
7073
require.NoError(err)
7174

@@ -171,6 +174,7 @@ func Test_Sync_FindNextKey_InSync(t *testing.T) {
171174
context.Background(),
172175
memdb.New(),
173176
newDefaultDBConfig(),
177+
"",
174178
)
175179
require.NoError(err)
176180

@@ -242,6 +246,7 @@ func Test_Sync_FindNextKey_Deleted(t *testing.T) {
242246
context.Background(),
243247
memdb.New(),
244248
newDefaultDBConfig(),
249+
"",
245250
)
246251
require.NoError(err)
247252
require.NoError(db.Put([]byte{0x10}, []byte{1}))
@@ -289,6 +294,7 @@ func Test_Sync_FindNextKey_BranchInLocal(t *testing.T) {
289294
context.Background(),
290295
memdb.New(),
291296
newDefaultDBConfig(),
297+
"",
292298
)
293299
require.NoError(err)
294300
require.NoError(db.Put([]byte{0x11}, []byte{1}))
@@ -325,6 +331,7 @@ func Test_Sync_FindNextKey_BranchInReceived(t *testing.T) {
325331
context.Background(),
326332
memdb.New(),
327333
newDefaultDBConfig(),
334+
"",
328335
)
329336
require.NoError(err)
330337
require.NoError(db.Put([]byte{0x11}, []byte{1}))
@@ -370,6 +377,7 @@ func Test_Sync_FindNextKey_ExtraValues(t *testing.T) {
370377
context.Background(),
371378
memdb.New(),
372379
newDefaultDBConfig(),
380+
"",
373381
)
374382
require.NoError(err)
375383

@@ -432,6 +440,7 @@ func TestFindNextKeyEmptyEndProof(t *testing.T) {
432440
context.Background(),
433441
memdb.New(),
434442
newDefaultDBConfig(),
443+
"",
435444
)
436445
require.NoError(err)
437446

@@ -501,6 +510,7 @@ func Test_Sync_FindNextKey_DifferentChild(t *testing.T) {
501510
context.Background(),
502511
memdb.New(),
503512
newDefaultDBConfig(),
513+
"",
504514
)
505515
require.NoError(err)
506516

@@ -551,6 +561,7 @@ func TestFindNextKeyRandom(t *testing.T) {
551561
context.Background(),
552562
memdb.New(),
553563
newDefaultDBConfig(),
564+
"",
554565
)
555566
require.NoError(err)
556567

@@ -559,6 +570,7 @@ func TestFindNextKeyRandom(t *testing.T) {
559570
context.Background(),
560571
memdb.New(),
561572
config,
573+
"",
562574
)
563575
require.NoError(err)
564576

@@ -937,6 +949,7 @@ func Test_Sync_Result_Correct_Root(t *testing.T) {
937949
ctx,
938950
memdb.New(),
939951
newDefaultDBConfig(),
952+
"",
940953
)
941954
require.NoError(err)
942955

@@ -1025,6 +1038,7 @@ func Test_Sync_Result_Correct_Root_With_Sync_Restart(t *testing.T) {
10251038
context.Background(),
10261039
memdb.New(),
10271040
newDefaultDBConfig(),
1041+
"",
10281042
)
10291043
require.NoError(err)
10301044

@@ -1122,6 +1136,7 @@ func Test_Sync_Result_Correct_Root_Update_Root_During(t *testing.T) {
11221136
context.Background(),
11231137
memdb.New(),
11241138
newDefaultDBConfig(),
1139+
"",
11251140
)
11261141
require.NoError(err)
11271142

@@ -1184,6 +1199,7 @@ func Test_Sync_UpdateSyncTarget(t *testing.T) {
11841199
context.Background(),
11851200
memdb.New(),
11861201
newDefaultDBConfig(),
1202+
"",
11871203
)
11881204
require.NoError(err)
11891205
ctx := context.Background()
@@ -1241,6 +1257,7 @@ func generateTrieWithMinKeyLen(t *testing.T, r *rand.Rand, count int, minKeyLen
12411257
context.Background(),
12421258
memdb.New(),
12431259
newDefaultDBConfig(),
1260+
"",
12441261
)
12451262
if err != nil {
12461263
return nil, err

0 commit comments

Comments
 (0)