This is needed for #22567.
By making the calls to generate*
member function of the test framework, it paves the way to make it easier to implicitly call the sync_all
member function.
This is needed for #22567.
By making the calls to generate*
member function of the test framework, it paves the way to make it easier to implicitly call the sync_all
member function.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
444@@ -445,10 +445,10 @@ def find_output(node, txid, amount, *, blockhash=None):
445
446 # Helper to create at least "count" utxos
447 # Pass in a fee that is sufficient for relay and mining new transactions.
448-def create_confirmed_utxos(fee, node, count):
449+def create_confirmed_utxos(test_framework, fee, node, count):
It feels slightly strange passing the TestFramework
object into these functions in util.py
.
Hopefully longer term, create_confirmed_utxos()
will be replaced by a miniwallet function, and mine_large_block()
and generate_to_height()
can be moved to the single files that use those functions.
generate_to_height
is removed, but the others remain for now
My intention when creating TestNode
was that it would be a batteries included programmatic API to the node. It’s used by the test framework, but can easily be reused for manual testing, stress testing, etc, since it has no dependencies on the framework. I’ve personally used it to control a mainnet node with a few tweaks.
This branch introduces a dependency from MiniWallet
on TestFramework
. I think that’s a shame, since it’d be nice if MiniWallet
could be used independently from the test framework for things like manual testing, like TestNode
can.
I’ve made a slight modification to this branch here: https://github.com/jnewbery/bitcoin/tree/pr22741.1 which doesn’t add that dependency. Let me know what you think.
618@@ -619,6 +619,26 @@ def join_network(self):
619 self.connect_nodes(1, 2)
620 self.sync_all()
621
622+ def generate(self, generator, nblocks, **kwargs):
623+ """
624+ Genarate nblocks blocks.
in commit 45817a7239cd5c0ef9126fbdf33bc72283eafa3a: Typo.
Also the signature can now be generalized to *args, **kwargs
?
24@@ -25,7 +25,7 @@
25 MAX_REPLACEMENT_LIMIT = 100
26
27
28-def make_utxo(node, amount, confirmed=True, scriptPubKey=DUMMY_P2WPKH_SCRIPT):
29+def make_utxo(test_framework, node, amount, confirmed=True, scriptPubKey=DUMMY_P2WPKH_SCRIPT):
ReplaceByFeeTest
now that it’s taking a test_framework
as its first argument.
Actually the diff won’t increase with the options --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
, so I went ahead to push the changes.
Also, I’ve reduced the other changes in this commit, because they can be done by scripted-diffs later on.
The changes in feature_rbf can be reviewed with
--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
Labels
Tests