diff --git a/src/Paprika.Tests/Chain/RawStateTests.cs b/src/Paprika.Tests/Chain/RawStateTests.cs index c90f0bf4..18daf529 100644 --- a/src/Paprika.Tests/Chain/RawStateTests.cs +++ b/src/Paprika.Tests/Chain/RawStateTests.cs @@ -61,7 +61,7 @@ public async Task Metadata_are_preserved() raw.Commit(keepOpened: true); raw.SetAccount(c, new Account(valueC, valueC)); - raw.Commit(keepOpened:true); + raw.Commit(keepOpened: true); var root = raw.Hash; @@ -143,10 +143,10 @@ public async Task DeleteByShortPrefix() raw.SetAccount(account1, new Account(1, 1)); raw.SetAccount(account2, new Account(2, 2)); - raw.Commit(); + raw.Commit(keepOpened: true); raw.RegisterDeleteByPrefix(Key.Account(NibblePath.FromKey(account2).SliceTo(1))); - raw.Commit(); + raw.Commit(keepOpened: true); raw.Finalize(1); @@ -159,10 +159,10 @@ public async Task DeleteByShortPrefix() using var raw2 = blockchain.StartRaw(); raw2.SetAccount(account2, new Account(2, 2)); - raw2.Commit(); + raw2.Commit(keepOpened: true); raw2.RegisterDeleteByPrefix(Key.Account(NibblePath.Empty)); - raw2.Commit(); + raw2.Commit(keepOpened: true); raw2.Finalize(2); @@ -186,13 +186,13 @@ public void DeleteByPrefixStorage() raw.SetAccount(account, new Account(1, 1)); raw.SetStorage(account, Values.Key2, new byte[] { 1, 2, 3, 4, 5 }); - raw.Commit(); + raw.Commit(keepOpened: true); using var read = db.BeginReadOnlyBatch(); read.TryGet(Key.StorageCell(NibblePath.FromKey(account), Values.Key2), out _).Should().BeTrue(); raw.RegisterDeleteByPrefix(Key.StorageCell(NibblePath.FromKey(account), NibblePath.Empty)); - raw.Commit(); + raw.Commit(keepOpened: true); raw.Finalize(1); diff --git a/src/Paprika/Chain/Blockchain.cs b/src/Paprika/Chain/Blockchain.cs index 4a45c171..be2edfb5 100644 --- a/src/Paprika/Chain/Blockchain.cs +++ b/src/Paprika/Chain/Blockchain.cs @@ -2165,7 +2165,7 @@ public void Commit(bool ensureHash, bool keepOpened) //commit without hash recalc - useful for storage ranges in snap sync if (ensureHash) Hash = _current.Hash; - + using var batch = _db.BeginNextBatch(); DeleteByPrefixes(batch);