shohu / c0ban

c0ban source tree
MIT License
0 stars 0 forks source link

Pass for test txn_doublespend.py #28

Closed shohu closed 6 years ago

shohu commented 6 years ago
# test/functional/txn_doublespend.py
2018-03-23 02:09:46.553000 TestFramework (INFO): Initializing test directory /tmp/testsjf62oky
2018-03-23 02:09:49.066000 TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/c0ban/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "test/functional/txn_doublespend.py", line 115, in run_test
    assert_equal(tx1["confirmations"], -2)
  File "/c0ban/test/functional/test_framework/util.py", line 38, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(0 == -2)
2018-03-23 02:09:49.078000 TestFramework (INFO): Stopping nodes
2018-03-23 02:09:51.357000 TestFramework (WARNING): Not cleaning up dir /tmp/testsjf62oky
2018-03-23 02:09:51.358000 TestFramework (ERROR): Test failed. Test logging available at /tmp/testsjf62oky/test_framework.log
shohu commented 6 years ago

testcode

        # Re-fetch transaction info:
        tx1 = self.nodes[0].gettransaction(txid1)
        tx2 = self.nodes[0].gettransaction(txid2)

        # Both transactions should be conflicted
        import pdb; pdb.set_trace()
        assert_equal(tx1["confirmations"], -2)
        assert_equal(tx2["confirmations"], -2)
shohu commented 6 years ago

👍

# test/functional/txn_doublespend.py
2018-03-23 02:28:52.176000 TestFramework (INFO): Initializing test directory /tmp/testn8rrahc_
2018-03-23 02:28:54.465000 TestFramework (INFO): Stopping nodes
2018-03-23 02:28:56.628000 TestFramework (INFO): Cleaning up
2018-03-23 02:28:56.654000 TestFramework (INFO): Tests successful