Esempio n. 1
0
        public Task InsertSpentOutputsAsync(Guid operationId, IEnumerable <IOutput> outputs)
        {
            var entities = outputs.Select(o => SpentOutputEntity.Create(o.TransactionHash, o.N, operationId));

            return(Task.WhenAll(entities.GroupBy(o => o.PartitionKey)
                                .Select(group => _table.InsertOrReplaceAsync(group))));
        }
Esempio n. 2
0
 public async Task <IEnumerable <IOutput> > GetSpentOutputsAsync(IEnumerable <IOutput> outputs)
 {
     return(await _table.GetDataAsync(outputs.Select(o =>
                                                     new Tuple <string, string>(SpentOutputEntity.GeneratePartitionKey(o.TransactionHash),
                                                                                SpentOutputEntity.GenerateRowKey(o.N)))));
 }