Esempio n. 1
0
        public Task UpsertBlockAsync(Block source)
        {
            CinderBlock document = source.MapToStorageEntityForUpsert <CinderBlock>();

            document.Sha3Uncles = source.Sha3Uncles;
            document.Uncles     = source.Uncles;
            document.UncleCount = source.Uncles.Length;
            return(UpsertDocumentAsync(document));
        }
Esempio n. 2
0
        public async Task UpsertBlockAsync(Nethereum.RPC.Eth.DTOs.Block source)
        {
            using (var context = _contextFactory.CreateContext())
            {
                var block = await context.Blocks.FindByBlockNumberAsync(source.Number).ConfigureAwait(false) ?? new Block();

                block.MapToStorageEntityForUpsert(source);
                context.Blocks.AddOrUpdate(block);

                await context.SaveChangesAsync().ConfigureAwait(false);
            }
        }
Esempio n. 3
0
        public async Task UpsertBlockAsync(Nethereum.RPC.Eth.DTOs.Block source)
        {
            var block = source.MapToStorageEntityForUpsert();

            await Write(block).ConfigureAwait(false);
        }