コード例 #1
0
ファイル: DbSnapshot.cs プロジェクト: NewEconoLab/NEL.LightDB
 public DbSnapshot(SimpleServerDB db)
 {
     this.db         = db;
     Blocks          = new DbCache <UInt256, BlockState>(db, Prefixes.DATA_Block);
     Transactions    = new DbCache <UInt256, TransactionState>(db, Prefixes.DATA_Transaction);
     Accounts        = new DbCache <UInt160, AccountState>(db, Prefixes.ST_Account);
     UnspentCoins    = new DbCache <UInt256, UnspentCoinState>(db, Prefixes.ST_Coin);
     SpentCoins      = new DbCache <UInt256, SpentCoinState>(db, Prefixes.ST_SpentCoin);
     Validators      = new DbCache <ECPoint, ValidatorState>(db, Prefixes.ST_Validator);
     Assets          = new DbCache <UInt256, AssetState>(db, Prefixes.ST_Asset);
     Contracts       = new DbCache <UInt160, ContractState>(db, Prefixes.ST_Contract);
     Storages        = new DbCache <StorageKey, StorageItem>(db, Prefixes.ST_Storage);
     HeaderHashList  = new DbCache <UInt32Wrapper, HeaderHashList>(db, Prefixes.IX_HeaderHashList);
     ValidatorsCount = new DbMetaDataCache <ValidatorsCountState>(db, Prefixes.IX_ValidatorsCount);
     BlockHashIndex  = new DbMetaDataCache <HashIndexState>(db, Prefixes.IX_CurrentBlock);
     HeaderHashIndex = new DbMetaDataCache <HashIndexState>(db, Prefixes.IX_CurrentHeader);
 }
コード例 #2
0
 public SimpleDBStore(Setting setting)
 {
     db = SimpleServerDB.Open(setting);
 }
コード例 #3
0
ファイル: DbCache.cs プロジェクト: NewEconoLab/NEL.LightDB
 public DbCache(SimpleServerDB db, byte prefix)
 {
     this.db     = db;
     this.prefix = prefix;
 }
コード例 #4
0
 public DbMetaDataCache(SimpleServerDB db, byte prefix, Func <T> factory = null)
     : base(factory)
 {
     this.db     = db;
     this.prefix = prefix;
 }