CityOfZion / neo-sharp

Neo-sharp is a new core and node implementation of NEO focused on modular design, best coding practices and testability.
MIT License
34 stars 24 forks source link

Add persistence transaction support on RocksDb #528

Closed aboimpinto closed 6 years ago

aboimpinto commented 6 years ago

To make sure that when we save a block all the data is "all in" or "all out", transaction support is need.

codecov[bot] commented 6 years ago

Codecov Report

Merging #528 into development will decrease coverage by 0.55%. The diff coverage is 8.79%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #528      +/-   ##
===============================================
- Coverage        49.92%   49.36%   -0.56%     
===============================================
  Files              315      315              
  Lines            12908    13060     +152     
===============================================
+ Hits              6444     6447       +3     
- Misses            6464     6613     +149
Impacted Files Coverage Δ
...lication/Attributes/ConsoleOutputStyleAttribute.cs 0% <0%> (ø) :arrow_up:
src/NeoSharp.Persistence.RocksDB/RocksDbContext.cs 0% <0%> (ø) :arrow_up:
...Sharp.Core/Blockchain/Processing/BlockPersister.cs 0% <0%> (ø) :arrow_up:
...Core/Blockchain/Processing/TransactionPersister.cs 100% <100%> (ø) :arrow_up:
.../NeoSharp.Persistence.RocksDB/RocksDbRepository.cs 80.22% <44.82%> (-6.82%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dc84bf6...7f60a00. Read the comment docs.

aboimpinto commented 6 years ago

well ... yes .. it woks and this is the code:

public void Rollback(Enlistment enlistment) { _currentWriteBatch.Dispose(); _currentWriteBatch = null; enlistment.Done(); }

mean that all the write batch is discarded and not executed ...

make all the sense in any case ... but if you don't like, there is nothing that I can do ...