public void StartOperation(int depth, long gas, Instruction opcode, int pc)
        {
//            var previousTraceEntry = _traceEntry;
            _traceEntry               = new StateTestTxTraceEntry();
            _traceEntry.Pc            = pc;
            _traceEntry.Operation     = (byte)opcode;
            _traceEntry.OperationName = Enum.GetName(typeof(Instruction), opcode);
            _traceEntry.Gas           = gas;
            _traceEntry.Depth         = depth;
            _trace.Entries.Add(_traceEntry);

//            if (_traceEntry.Depth > (previousTraceEntry?.Depth ?? 0))
//            {
//                _traceEntry.Storage = new Dictionary<string, string>();
//                _trace.StorageByDepth.Push(previousTraceEntry != null ? previousTraceEntry.Storage : new Dictionary<string, string>());
//            }
//            else if (_traceEntry.Depth < (previousTraceEntry?.Depth ?? 0))
//            {
//                if (previousTraceEntry == null)
//                {
//                    throw new InvalidOperationException("Unexpected missing previous trace when leaving a call.");
//                }
//
//                _traceEntry.Storage = new Dictionary<string, string>(_trace.StorageByDepth.Pop());
//            }
//            else
//            {
//                if (previousTraceEntry == null)
//                {
//                    throw new InvalidOperationException("Unexpected missing previous trace on continuation.");
//                }
//
//                _traceEntry.Storage = new Dictionary<string, string>(previousTraceEntry.Storage);
//            }
        }
Beispiel #2
0
 public void StartOperation(int depth, long gas, Instruction opcode, int pc)
 {
     _gasAlreadySetForCurrentOp = false;
     _traceEntry               = new StateTestTxTraceEntry();
     _traceEntry.Pc            = pc;
     _traceEntry.Operation     = (byte)opcode;
     _traceEntry.OperationName = Enum.GetName(typeof(Instruction), opcode);
     _traceEntry.Gas           = gas;
     _traceEntry.Depth         = depth;
     _trace.Entries.Add(_traceEntry);
 }