Skip to content

Instantly share code, notes, and snippets.

@dexX7
Created March 21, 2015 12:52
Show Gist options
  • Select an option

  • Save dexX7/9f6f33444d8df1de63a5 to your computer and use it in GitHub Desktop.

Select an option

Save dexX7/9f6f33444d8df1de63a5 to your computer and use it in GitHub Desktop.
Test: sort pending wallet transactions before reaccepting
https://github.com/bitcoin/bitcoin
https://gist.github.com/dexX7/06df91d1a7f99190d8d6#file-walletreaccept-py
commit f3948a30cd27928fdf9dffbbf90ea6430c869edf
Date: Fri Mar 20 16:29:26 2015 +0100
===============================================
~/Projects/Cpp/bitcoin/qa/rpc-tests$ ./walletreaccept-py
INFO:Initializing test directory /tmp/testMwserc
INFO:Generate 101 blocks
INFO:Node should have 50.0 spendable bitcoin
INFO:Send 20 random transactions
INFO:Node should have 20 transactions in mempool
INFO:Shutdown and restart client
INFO:Node should reaccept all transactions and have 20 transactions in mempool
Assertion failed: 4 != 20
File "~/Projects/Cpp/bitcoin/qa/rpc-tests/test_framework.py", line 117, in main
self.run_test()
File "./walletreaccept-py", line 52, in run_test
assert_equal(len(self.nodes[0].getrawmempool()), 20)
File "~/Projects/Cpp/bitcoin/qa/rpc-tests/util.py", line 329, in assert_equal
raise AssertionError("%s != %s"%(str(thing1),str(thing2)))
Cleaning up
Failed
-----------------------------------------------
After cherry-picking and signing:
commit e9c3215b776b07faeb5184249fc0e43876f26723
Date: Fri Dec 19 06:59:16 2014 +0100
===============================================
~/Projects/Cpp/bitcoin/qa/rpc-tests$ ./walletreaccept-py
INFO:Initializing test directory /tmp/test8NqJ0A
INFO:Generate 101 blocks
INFO:Node should have 50.0 spendable bitcoin
INFO:Send 20 random transactions
INFO:Node should have 20 transactions in mempool
INFO:Shutdown and restart client
INFO:Node should reaccept all transactions and have 20 transactions in mempool
INFO:Generate 1 block
INFO:Node should have 0 transactions in mempool
Cleaning up
Tests successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment