public object[] Call(CallInfo callInfo) { lock (_readOnlyTxProcessorSource) { using var readOnlyTransactionProcessor = _readOnlyTxProcessorSource.Build(GetState(callInfo.ParentHeader)); return CallRaw(callInfo, readOnlyTransactionProcessor); } }
public void SetUp() { _block = new Block(Build.A.BlockHeader.TestObject, new BlockBody()); _transactionProcessor = Substitute.For <IReadOnlyTransactionProcessor>(); _readOnlyTxProcessorSource = Substitute.For <IReadOnlyTxProcessorSource>(); _readOnlyTxProcessorSource.Build(TestItem.KeccakA).Returns(_transactionProcessor); _stateProvider = Substitute.For <IStateProvider>(); _stateProvider.StateRoot.Returns(TestItem.KeccakA); }
public override object[] Call(CallInfo callInfo) { Keccak GetState(BlockHeader parentHeader) => parentHeader?.StateRoot ?? Keccak.EmptyTreeHash; lock (_readOnlyTxProcessorSource) { using var readOnlyTransactionProcessor = _readOnlyTxProcessorSource.Build(GetState(callInfo.ParentHeader)); return(CallRaw(callInfo, readOnlyTransactionProcessor)); } }