@@ -26,7 +26,7 @@ public void InitializesGenesisBlockAndTxIndexOnFirstLoad()
2626 byte [ ] blockRow = engine . Get ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) ) ;
2727 bool txIndexRow = BitConverter . ToBoolean ( engine . Get ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) ) ) ;
2828
29- Assert . Equal ( this . Network . GetGenesis ( ) . GetHash ( ) , this . DBreezeSerializer . Deserialize < HashHeightPair > ( blockRow ) . Hash ) ;
29+ Assert . Equal ( this . Network . GetGenesis ( ) . GetHash ( ) , this . DataStoreSerializer . Deserialize < HashHeightPair > ( blockRow ) . Hash ) ;
3030 Assert . False ( txIndexRow ) ;
3131 }
3232 }
@@ -38,7 +38,7 @@ public void DoesNotOverwriteExistingBlockAndTxIndexOnFirstLoad()
3838
3939 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
4040 {
41- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( new uint256 ( 56 ) , 1 ) ) ) ;
41+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( new uint256 ( 56 ) , 1 ) ) ) ;
4242 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( true ) ) ;
4343 }
4444
@@ -51,7 +51,7 @@ public void DoesNotOverwriteExistingBlockAndTxIndexOnFirstLoad()
5151 byte [ ] blockRow = engine . Get ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) ) ;
5252 bool txIndexRow = BitConverter . ToBoolean ( engine . Get ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) ) ) ;
5353
54- Assert . Equal ( new HashHeightPair ( new uint256 ( 56 ) , 1 ) , this . DBreezeSerializer . Deserialize < HashHeightPair > ( blockRow ) ) ;
54+ Assert . Equal ( new HashHeightPair ( new uint256 ( 56 ) , 1 ) , this . DataStoreSerializer . Deserialize < HashHeightPair > ( blockRow ) ) ;
5555 Assert . True ( txIndexRow ) ;
5656 }
5757 }
@@ -63,7 +63,7 @@ public void GetTrxAsyncWithoutTransactionIndexReturnsNewTransaction()
6363
6464 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
6565 {
66- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
66+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
6767 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( false ) ) ;
6868 }
6969
@@ -81,7 +81,7 @@ public void GetTrxAsyncWithoutTransactionInIndexReturnsNull()
8181 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
8282 {
8383 var blockId = new uint256 ( 8920 ) ;
84- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
84+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
8585 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( true ) ) ;
8686 }
8787
@@ -106,7 +106,7 @@ public void GetTrxAsyncWithTransactionReturnsExistingTransaction()
106106
107107 engine . Put ( DBH . Key ( BlockRepository . BlockTableName , block . Header . GetHash ( ) . ToBytes ( ) ) , block . ToBytes ( ) ) ;
108108 engine . Put ( DBH . Key ( BlockRepository . TransactionTableName , trans . GetHash ( ) . ToBytes ( ) ) , block . Header . GetHash ( ) . ToBytes ( ) ) ;
109- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
109+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
110110 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( true ) ) ;
111111 }
112112
@@ -123,7 +123,7 @@ public void GetTrxBlockIdAsyncWithoutTxIndexReturnsDefaultId()
123123
124124 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
125125 {
126- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
126+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
127127 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( false ) ) ;
128128 }
129129
@@ -140,7 +140,7 @@ public void GetTrxBlockIdAsyncWithoutExistingTransactionReturnsNull()
140140
141141 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
142142 {
143- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
143+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
144144 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( true ) ) ;
145145 }
146146
@@ -158,7 +158,7 @@ public void GetTrxBlockIdAsyncWithTransactionReturnsBlockId()
158158 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
159159 {
160160 engine . Put ( DBH . Key ( BlockRepository . TransactionTableName , new uint256 ( 26 ) . ToBytes ( ) ) , new uint256 ( 42 ) . ToBytes ( ) ) ;
161- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
161+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
162162 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( true ) ) ;
163163 }
164164
@@ -195,7 +195,7 @@ public void PutAsyncWritesBlocksAndTransactionsToDbAndSavesNextBlockHash()
195195
196196 using ( var engine = new DB ( new Options ( ) { CreateIfMissing = true } , dir ) )
197197 {
198- engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DBreezeSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
198+ engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 0 ] ) , this . DataStoreSerializer . Serialize ( new HashHeightPair ( uint256 . Zero , 1 ) ) ) ;
199199 engine . Put ( DBH . Key ( BlockRepository . CommonTableName , new byte [ 1 ] ) , BitConverter . GetBytes ( true ) ) ;
200200 }
201201
@@ -211,7 +211,7 @@ public void PutAsyncWritesBlocksAndTransactionsToDbAndSavesNextBlockHash()
211211 Dictionary < byte [ ] , byte [ ] > blockDict = engine . SelectDictionary ( BlockRepository . BlockTableName ) ;
212212 Dictionary < byte [ ] , byte [ ] > transDict = engine . SelectDictionary ( BlockRepository . TransactionTableName ) ;
213213
214- Assert . Equal ( new HashHeightPair ( nextBlockHash , 100 ) , this . DBreezeSerializer . Deserialize < HashHeightPair > ( blockHashKeyRow ) ) ;
214+ Assert . Equal ( new HashHeightPair ( nextBlockHash , 100 ) , this . DataStoreSerializer . Deserialize < HashHeightPair > ( blockHashKeyRow ) ) ;
215215 Assert . Equal ( 2 , blockDict . Count ) ;
216216 Assert . Equal ( 3 , transDict . Count ) ;
217217
@@ -362,7 +362,7 @@ public void DeleteAsyncRemovesBlocksAndTransactions()
362362 Dictionary < byte [ ] , byte [ ] > blockDict = engine . SelectDictionary ( BlockRepository . BlockTableName ) ;
363363 Dictionary < byte [ ] , byte [ ] > transDict = engine . SelectDictionary ( BlockRepository . TransactionTableName ) ;
364364
365- Assert . Equal ( tip , this . DBreezeSerializer . Deserialize < HashHeightPair > ( blockHashKeyRow ) ) ;
365+ Assert . Equal ( tip , this . DataStoreSerializer . Deserialize < HashHeightPair > ( blockHashKeyRow ) ) ;
366366 Assert . Empty ( blockDict ) ;
367367 Assert . Empty ( transDict ) ;
368368 }
@@ -397,7 +397,7 @@ public void ReIndexAsync_TxIndex_OffToOn()
397397
398398 // Block stored as expected.
399399 Assert . Single ( blockDict ) ;
400- Assert . Equal ( block . GetHash ( ) , this . DBreezeSerializer . Deserialize < Block > ( blockDict . FirstOrDefault ( ) . Value ) . GetHash ( ) ) ;
400+ Assert . Equal ( block . GetHash ( ) , this . DataStoreSerializer . Deserialize < Block > ( blockDict . FirstOrDefault ( ) . Value ) . GetHash ( ) ) ;
401401
402402 // Transaction row in database stored as expected.
403403 Assert . Single ( transDict ) ;
@@ -437,7 +437,7 @@ public void ReIndexAsync_TxIndex_OnToOff()
437437
438438 // Block still stored as expected.
439439 Assert . Single ( blockDict ) ;
440- Assert . Equal ( block . GetHash ( ) , this . DBreezeSerializer . Deserialize < Block > ( blockDict . FirstOrDefault ( ) . Value ) . GetHash ( ) ) ;
440+ Assert . Equal ( block . GetHash ( ) , this . DataStoreSerializer . Deserialize < Block > ( blockDict . FirstOrDefault ( ) . Value ) . GetHash ( ) ) ;
441441
442442 // No transactions indexed.
443443 Assert . Empty ( transDict ) ;
@@ -536,7 +536,7 @@ public void GetBlockIdByTransactionIdForGenesisBlock()
536536
537537 private IBlockRepository SetupRepository ( Network main , string dir )
538538 {
539- var dBreezeSerializer = new DBreezeSerializer ( main . Consensus . ConsensusFactory ) ;
539+ var dBreezeSerializer = new DataStoreSerializer ( main . Consensus . ConsensusFactory ) ;
540540
541541 var repository = new BlockRepository ( main , dir , this . LoggerFactory . Object , dBreezeSerializer ) ;
542542 repository . Initialize ( ) ;
0 commit comments