示例#1
0
 public void reset(string version)
 {
     batch.DeleteTable(new byte[] { Prefixes.DATA_Block });
     batch.DeleteTable(new byte[] { Prefixes.DATA_Transaction });
     batch.DeleteTable(new byte[] { Prefixes.ST_Account });
     batch.DeleteTable(new byte[] { Prefixes.ST_Coin });
     batch.DeleteTable(new byte[] { Prefixes.ST_SpentCoin });
     batch.DeleteTable(new byte[] { Prefixes.ST_Validator });
     batch.DeleteTable(new byte[] { Prefixes.ST_Asset });
     batch.DeleteTable(new byte[] { Prefixes.ST_Contract });
     batch.DeleteTable(new byte[] { Prefixes.ST_Storage });
     batch.DeleteTable(new byte[] { Prefixes.IX_HeaderHashList });
     batch.DeleteTable(new byte[] { Prefixes.SYS_DefaulTableId });
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.DATA_Block }, "_data_block", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.DATA_Transaction }, "_data_transaction", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_Account }, "_st_account", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_Coin }, "_st_coin", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_SpentCoin }, "_st_spentcoin", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_Validator }, "_st_validator", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_Asset }, "_st_asset", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_Contract }, "_st_contract", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.ST_Storage }, "_st_storage", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.IX_HeaderHashList }, "_ix_headerhashlist", null, LTDBValue.Type.UINT64));
     batch.CreateTable(new LTTableInfo(new byte[] { Prefixes.SYS_DefaulTableId }, "_sys_defaulttableid", null, LTDBValue.Type.UINT64));
     batch.Put(new byte[] { Prefixes.SYS_DefaulTableId }, new byte[] { Prefixes.SYS_Version }, LTDBValue.FromValue(LTDBValue.Type.String, version));
 }
示例#2
0
 protected override void UpdateInternal(T item)
 {
     batch?.Put(defaultTableid, new byte[] { prefix }, LTDBValue.FromValue(LTDBValue.Type.Bytes, item.ToArray()));
 }
示例#3
0
 internal Slice(LTDBValue value)
 {
     buffer = value.value;
 }
示例#4
0
 protected override void UpdateInternal(TKey key, TValue value)
 {
     batch?.Put(new byte[] { prefix }, key.ToArray(), LTDBValue.FromValue(LTDBValue.Type.Bytes, value.ToArray()));
 }
示例#5
0
 protected override void AddInternal(TKey key, TValue value)
 {
     batch?.Put(new byte[] { }, (new byte[] { prefix }).Concat(key.ToArray()).ToArray(), LTDBValue.FromValue(LTDBValue.Type.Bytes, value.ToArray()));
 }