示例#1
0
        public async Task <IBitcoinBlock> GetAsync(string block)
        {
            var partitionKey = BicoinBlockEntity.GeneratePartiteonKey();
            var rowKey       = BicoinBlockEntity.GenerateRowKey(block);

            return(await _tableStorage.GetDataAsync(partitionKey, rowKey));
        }
示例#2
0
        public static BicoinBlockEntity CreateNew(IBitcoinBlock src)
        {
            var result = new BicoinBlockEntity
            {
                PartitionKey      = GeneratePartiteonKey(),
                RowKey            = GenerateRowKey(src.Hash),
                Time              = src.Time,
                Height            = src.Height,
                Difficulty        = src.Difficulty,
                Merkleroot        = src.Merkleroot,
                Nextblockhash     = src.Nextblockhash,
                Nonce             = src.Nonce,
                Previousblockhash = src.Previousblockhash,
                TotalTransactions = src.TotalTransactions
            };

            return(result);
        }
示例#3
0
        public Task SaveAsync(IBitcoinBlock bitcoinBlock)
        {
            var newEntity = BicoinBlockEntity.CreateNew(bitcoinBlock);

            return(_tableStorage.InsertOrReplaceAsync(newEntity));
        }