Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[tests] mining functional tests (including regression test for submitblock) #10190
+125
−158
Conversation
jnewbery
referenced
this pull request
Apr 11, 2017
Merged
Better error handling for submitblock #10146
fanquake
added Mining Tests
labels
Apr 12, 2017
| +# Copyright (c) 2014-2016 The Bitcoin Core developers | ||
| +# Distributed under the MIT software license, see the accompanying | ||
| +# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
| +"""Test block proposals with getblocktemplate.""" |
| + rsp = node.getblocktemplate({'data': b2x(block.serialize()), 'mode': 'proposal'}) | ||
| + assert_equal(rsp, expect) | ||
| + | ||
| +class GetBlockTemplateProposalTest(BitcoinTestFramework): |
| + assert_template(node, bad_block, 'inconclusive-not-best-prevblk') | ||
| + | ||
| +if __name__ == '__main__': | ||
| + GetBlockTemplateProposalTest().main() |
| + # sequence numbers must not be max for nLockTime to have effect | ||
| + coinbase_tx.vin[0].nSequence = 2 ** 32 - 2 | ||
| + tmpl['coinbasetxn'] = {'data': coinbase_tx.serialize()} | ||
| + txlist = [bytearray(coinbase_tx.serialize())] |
|
Concept ACK. I am testing the test. |
|
No great rush for this but it'd be good to get it in soonish. It includes a regression test for #10146, which was backported to 0.14.1. Other benefits:
|
MarcoFalke
added this to the
0.15.0
milestone
Jun 18, 2017
MarcoFalke
was assigned
by laanwj
Jun 26, 2017
jnewbery
added some commits
Apr 11, 2017
|
rebased |
jnewbery
changed the title from
Mining functional tests (including regression test for submitblock) to [tests] mining functional tests (including regression test for submitblock)
Jun 30, 2017
|
utACK 11ba8e9 |
laanwj
merged commit 11ba8e9
into
bitcoin:master
Jul 11, 2017
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
laanwj
added a commit
that referenced
this pull request
Jul 11, 2017
|
|
laanwj |
e4f226a
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jnewbery commentedApr 11, 2017
•
edited
This PR refactors the getblocktemplate_proposals.py functional test into a more general mining test, which covers the
submitblockRPC as well as thegetblocktemplatepropose mode.Motivation was to add a regression test for #10146
This test removes all the manual block/transaction construction from the test case and uses the mininode classes to achieve the same tests. Result is less lines of code, and hopefully clearer and easier for people to extend/maintain since we're no longer hacking bits in a serialised block.
@gmaxwell since he wrote the fix for #10146
EDIT: there are lots of commits in this PR to aid reviewers. They can be squashed down into larger commits before merging.