Beispiel #1
0
        public DebugBridge(
            IConfigProvider configProvider,
            IReadOnlyDbProvider dbProvider,
            IGethStyleTracer tracer,
            IBlockTree blockTree,
            IReceiptStorage receiptStorage,
            IReceiptsMigration receiptsMigration,
            ISpecProvider specProvider)
        {
            _configProvider    = configProvider ?? throw new ArgumentNullException(nameof(configProvider));
            _tracer            = tracer ?? throw new ArgumentNullException(nameof(tracer));
            _blockTree         = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _receiptStorage    = receiptStorage ?? throw new ArgumentNullException(nameof(receiptStorage));
            _receiptsMigration = receiptsMigration ?? throw new ArgumentNullException(nameof(receiptsMigration));
            _specProvider      = specProvider ?? throw new ArgumentNullException(nameof(specProvider));
            dbProvider         = dbProvider ?? throw new ArgumentNullException(nameof(dbProvider));
            IDb blockInfosDb = dbProvider.BlockInfosDb ?? throw new ArgumentNullException(nameof(dbProvider.BlockInfosDb));
            IDb blocksDb     = dbProvider.BlocksDb ?? throw new ArgumentNullException(nameof(dbProvider.BlocksDb));
            IDb headersDb    = dbProvider.HeadersDb ?? throw new ArgumentNullException(nameof(dbProvider.HeadersDb));
            IDb receiptsDb   = dbProvider.ReceiptsDb ?? throw new ArgumentNullException(nameof(dbProvider.ReceiptsDb));
            IDb codeDb       = dbProvider.CodeDb ?? throw new ArgumentNullException(nameof(dbProvider.CodeDb));
            IDb pendingTxsDb = dbProvider.PendingTxsDb ?? throw new ArgumentNullException(nameof(dbProvider.PendingTxsDb));

            _dbMappings = new Dictionary <string, IDb>(StringComparer.InvariantCultureIgnoreCase)
            {
                { DbNames.State, dbProvider.StateDb },
                { DbNames.Storage, dbProvider.StateDb },
                { DbNames.BlockInfos, blockInfosDb },
                { DbNames.Blocks, blocksDb },
                { DbNames.Headers, headersDb },
                { DbNames.Code, codeDb },
                { DbNames.Receipts, receiptsDb },
                { DbNames.PendingTxs, pendingTxsDb },
            };
        }
Beispiel #2
0
        public DebugBridge(IConfigProvider configProvider, IReadOnlyDbProvider dbProvider, IGethStyleTracer tracer, IBlockProcessingQueue receiptsBlockQueue, IBlockTree blockTree)
        {
            receiptsBlockQueue.ProcessingQueueEmpty += (sender, args) => _receiptProcessedEvent.Set();
            _configProvider = configProvider ?? throw new ArgumentNullException(nameof(configProvider));
            _tracer         = tracer ?? throw new ArgumentNullException(nameof(tracer));
            _blockTree      = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            dbProvider      = dbProvider ?? throw new ArgumentNullException(nameof(dbProvider));
            IDb blockInfosDb = dbProvider.BlockInfosDb ?? throw new ArgumentNullException(nameof(dbProvider.BlockInfosDb));
            IDb blocksDb     = dbProvider.BlocksDb ?? throw new ArgumentNullException(nameof(dbProvider.BlocksDb));
            IDb headersDb    = dbProvider.HeadersDb ?? throw new ArgumentNullException(nameof(dbProvider.HeadersDb));
            IDb receiptsDb   = dbProvider.ReceiptsDb ?? throw new ArgumentNullException(nameof(dbProvider.ReceiptsDb));
            IDb codeDb       = dbProvider.CodeDb ?? throw new ArgumentNullException(nameof(dbProvider.CodeDb));
            IDb pendingTxsDb = dbProvider.PendingTxsDb ?? throw new ArgumentNullException(nameof(dbProvider.PendingTxsDb));

            _dbMappings = new Dictionary <string, IDb>(StringComparer.InvariantCultureIgnoreCase)
            {
                { DbNames.State, dbProvider.StateDb },
                { DbNames.Storage, dbProvider.StateDb },
                { DbNames.BlockInfos, blockInfosDb },
                { DbNames.Blocks, blocksDb },
                { DbNames.Headers, headersDb },
                { DbNames.Code, codeDb },
                { DbNames.Receipts, receiptsDb },
                { DbNames.PendingTxs, pendingTxsDb },
            };
        }