Пример #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);
        }
        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);
        }