コード例 #1
0
 public void StartNewBlockTrace(Block block)
 {
     for (int index = 0; index < _childTracers.Count; index++)
     {
         IBlockTracer childTracer = _childTracers[index];
         childTracer.StartNewBlockTrace(block);
     }
 }
コード例 #2
0
        public void StartNewBlockTrace(Block block)
        {
            if (_otherTracer == null)
            {
                throw new InvalidOperationException("other tracer not set in receipts tracer");
            }

            _block        = block;
            _currentIndex = 0;
            TxReceipts    = new TxReceipt[_block.Transactions.Length];
            _otherTracer.StartNewBlockTrace(block);
        }
コード例 #3
0
        public Block?Trace(Block block, IBlockTracer blockTracer)
        {
            try
            {
                blockTracer.StartNewBlockTrace(block);

                /* We force process since we want to process a block that has already been processed in the past and normally it would be ignored.
                 * We also want to make it read only so the state is not modified persistently in any way. */
                Block?processedBlock = _blockProcessor.Process(block, ProcessingOptions.ForceProcessing | ProcessingOptions.ReadOnlyChain | ProcessingOptions.NoValidation, blockTracer);
                blockTracer.EndBlockTrace();
                return(processedBlock);
            }
            catch (Exception)
            {
                _stateProvider.Reset();
                throw;
            }
        }
コード例 #4
0
        public Keccak Trace(Block block, IBlockTracer blockTracer)
        {
            /* We force process since we want to process a block that has already been processed in the past and normally it would be ignored.
             * We also want to make it read only so the state is not modified persistently in any way. */

            blockTracer.StartNewBlockTrace(block);

            try
            {
                _blockProcessor.Process(block, ProcessingOptions.Trace, blockTracer);
            }
            catch (Exception)
            {
                _stateProvider.Reset();
                throw;
            }

            return(_stateProvider.StateRoot);
        }