コード例 #1
0
 public object[] Call(CallInfo callInfo)
 {
     lock (_readOnlyTxProcessorSource)
     {
         using var readOnlyTransactionProcessor = _readOnlyTxProcessorSource.Build(GetState(callInfo.ParentHeader));
         return CallRaw(callInfo, readOnlyTransactionProcessor);
     }
 }
コード例 #2
0
 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);
 }
コード例 #3
0
            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));
                }
            }