diff --git a/platform/common/core/generic/vault/helpers.go b/platform/common/core/generic/vault/helpers.go index e4055d036..a95286702 100644 --- a/platform/common/core/generic/vault/helpers.go +++ b/platform/common/core/generic/vault/helpers.go @@ -559,7 +559,7 @@ func TTestMerge(t *testing.T, ddb VersionedPersistence, vp artifactsProvider) { }, } rwsb.ReadSet.Add(ns, k1, versionBlockTxNumToBytes(35, 1)) - rwsb.ReadSet.Add(ns, ne2Key, versionBlockTxNumToBytes(0, 0)) + rwsb.ReadSet.Add(ns, ne2Key, nil) rwsb.WriteSet.Add(ns, k1, []byte("newv1")) rwsb.MetaWriteSet.Add(ns, k1, map[string][]byte{"k1": []byte("v1")}) m := vp.NewMarshaller() diff --git a/platform/view/services/db/dbtest/helpers.go b/platform/view/services/db/dbtest/helpers.go index dc70e745a..5eeac450a 100644 --- a/platform/view/services/db/dbtest/helpers.go +++ b/platform/view/services/db/dbtest/helpers.go @@ -184,7 +184,9 @@ func TTestRangeQueries(t *testing.T, db driver.TransactionalVersionedPersistence res = append(res, *n) } assert.Len(t, res, 2) - assert.Equal(t, expected, res) + for _, read := range expected { + assert.Contains(t, res, read) + } } func TTestMeta(t *testing.T, db driver.TransactionalVersionedPersistence) { @@ -215,7 +217,7 @@ func TTestMeta(t *testing.T, db driver.TransactionalVersionedPersistence) { err = db.BeginUpdate() assert.NoError(t, err) - err = db.SetStateMetadata(ns, key, map[string][]byte{"foo": []byte("bar")}, nil) + err = db.SetStateMetadata(ns, key, map[string][]byte{"foo": []byte("bar")}, ToBytes(36, 2)) assert.NoError(t, err) err = db.Commit() @@ -380,7 +382,7 @@ func TTestMetadata(t *testing.T, db driver.TransactionalVersionedPersistence) { err = db.BeginUpdate() assert.NoError(t, err) - err = db.SetStateMetadata(ns, key, map[string][]byte{"foo": []byte("bar")}, nil) + err = db.SetStateMetadata(ns, key, map[string][]byte{"foo": []byte("bar")}, ToBytes(35, 1)) assert.NoError(t, err) err = db.Commit() assert.NoError(t, err) @@ -395,7 +397,7 @@ func TTestMetadata(t *testing.T, db driver.TransactionalVersionedPersistence) { err = db.BeginUpdate() assert.NoError(t, err) - err = db.SetStateMetadata(ns, key, map[string][]byte{"foo1": []byte("bar1")}, nil) + err = db.SetStateMetadata(ns, key, map[string][]byte{"foo1": []byte("bar1")}, ToBytes(36, 2)) assert.NoError(t, err) err = db.Commit() assert.NoError(t, err) @@ -867,10 +869,13 @@ func TTestUnversionedRange(t *testing.T, db driver.UnversionedPersistence) { res = append(res, *n) } assert.Len(t, res, 2) - assert.Equal(t, []driver.UnversionedRead{ + expected := []driver.UnversionedRead{ {Key: "k1", Raw: []byte("k1_value")}, {Key: "k2", Raw: []byte("k2_value")}, - }, res) + } + for _, read := range expected { + assert.Contains(t, res, read) + } } func TTestUnversionedSimple(t *testing.T, db driver.UnversionedPersistence) {