public void Sets_state_root_if_provided_on_success() { Block block = Build.A.Block.WithTransactions(MuirGlacier.Instance, Build.A.Transaction.TestObject).TestObject; BlockReceiptsTracer tracer = new BlockReceiptsTracer(); tracer.SetOtherTracer(NullBlockTracer.Instance); tracer.StartNewBlockTrace(block); tracer.StartNewTxTrace(block.Transactions[0].Hash); tracer.MarkAsSuccess(TestItem.AddressA, 100, new byte[0], new LogEntry[0], TestItem.KeccakF); Assert.AreEqual(TestItem.KeccakF, tracer.TxReceipts[0].PostTransactionState); }
public void Invokes_other_tracer_mark_as_success_if_other_block_tracer_is_tx_tracer_too() { Block block = Build.A.Block.WithTransactions(MuirGlacier.Instance, Build.A.Transaction.TestObject).TestObject; IBlockTracer otherTracer = Substitute.For <IBlockTracer, ITxTracer>(); BlockReceiptsTracer tracer = new BlockReceiptsTracer(); tracer.SetOtherTracer(otherTracer); tracer.StartNewBlockTrace(block); tracer.StartNewTxTrace(block.Transactions[0].Hash); var logEntries = new LogEntry[0]; tracer.MarkAsSuccess(TestItem.AddressA, 100, Array.Empty <byte>(), logEntries, TestItem.KeccakF); (otherTracer as ITxTracer).Received().MarkAsSuccess(TestItem.AddressA, 100, Array.Empty <byte>(), logEntries, TestItem.KeccakF); }