Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Move deterministic address import to setup_nodes #14631

Merged
merged 1 commit into from Nov 2, 2018

Conversation

@jnewbery
Copy link
Member

@jnewbery jnewbery commented Nov 1, 2018

This requires a small changes to a few tests, but means that
deterministic addresses will always be imported (unless setup_nodes
behaviour is explicitly overridden).

Tidies up the way we import deterministic addresses, requested in review comment here: #14468 (comment).

Copy link
Contributor

@ryanofsky ryanofsky left a comment

utACK ef91935ad045b60017924c990983bc0474f26ec0. I only superficially understand this change, but it seems to do what's described and simplify things.

super().import_deterministic_coinbase_privkeys()
self.num_cb_reward_addresses = len(self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True))
def setup_network(self):
super().setup_network()
Copy link
Contributor

@ryanofsky ryanofsky Nov 1, 2018

Maybe needs comment. Why override if just calling super?

Copy link
Member Author

@jnewbery jnewbery Nov 1, 2018

oops. vestigial from a previous version. Removed.

This requires a small changes to a few tests, but means that
deterministic addresses will always be imported (unless setup_nodes
behaviour is explicitly overridden).
@jnewbery jnewbery force-pushed the deprecate_generate2 branch from ef91935 to 3fd7e76 Nov 1, 2018
@fanquake fanquake added the Tests label Nov 1, 2018
@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Nov 1, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

utACK 3fd7e76, only change since last review is removing unneeded override.

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Nov 2, 2018

utACK 3fd7e76

@MarcoFalke MarcoFalke merged commit 3fd7e76 into bitcoin:master Nov 2, 2018
2 checks passed
MarcoFalke added a commit that referenced this issue Nov 2, 2018
3fd7e76 [tests] Move deterministic address import to setup_nodes (John Newbery)

Pull request description:

  This requires a small changes to a few tests, but means that
  deterministic addresses will always be imported (unless setup_nodes
  behaviour is explicitly overridden).

  Tidies up the way we import deterministic addresses, requested in review comment here: #14468 (comment).

Tree-SHA512: 2b32edf500e286c463398487ab1153116a1dc90f64a53614716373311abdc83d8a251fdd8f42d1146b56e308664deaf62952113f66e98bc37f23968096d1a961
deadalnix added a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue May 6, 2020
Summary:
Adds a generate() method to the TestNode class in the test framework.
This method intercepts calls to generate, imports a dewterministic
private key to the node and then calls generatetoaddress to generate the
block to that address.

Note that repeated calls to importprivkey for the same private keys are
no-ops, so it's fine to call the generate() method many times.

This is a partial backport of Core [[bitcoin/bitcoin#14468 | PR14468]] : bitcoin/bitcoin@aab8172

The code was slightly tweaked because we have some tests for which `self.rpc` is `None` because they've been created after [[bitcoin/bitcoin#14631 | PR14631]] which remove the call to importprivkey

Depends on D5969

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: majcosta

Differential Revision: https://reviews.bitcoinabc.org/D5970
deadalnix added a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue May 6, 2020
Summary:
This requires a small changes to a few tests, but means that
deterministic addresses will always be imported (unless setup_nodes
behaviour is explicitly overridden).

This is a backport of Core [[bitcoin/bitcoin#14631 | PR14631]]

Depends on D5972

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: majcosta, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5973
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants