Skip to content

test: add test for signet miner script - #24559

Merged
laanwj merged 3 commits into
bitcoin:masterfrom
theStack:202203-test-add_test_for_signet_miner
Apr 14, 2022
Merged

laanwj merged 3 commits into
bitcoin:masterfrom
theStack:202203-test-add_test_for_signet_miner

Conversation

@theStack

@theStack theStack commented Mar 14, 2022 •

Copy link
Copy Markdown
Contributor

This PR adds a very basic test for the signet miner script (contrib/signet/miner). It was based on #24553 (merged by now) which fixes a bug (and was also the motivation to write this test).

The test roughly follows the steps from https://en.bitcoin.it/wiki/Signet#Custom_Signet, except that the challenge key-pair is created solely with the test framework. Calibration is also skipped, the difficulty is simply set to the first mainnet target 0x1d00ffff (see also https://bitcoin.stackexchange.com/a/57186).

@theStack
theStack force-pushed the 202203-test-add_test_for_signet_miner branch 6 times, most recently from 11f79b7 to aaa81d2 Compare March 14, 2022 16:46
@DrahtBot

DrahtBot commented Mar 14, 2022 •

Copy link
Copy Markdown
Contributor

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #20892 (tests: Run both descriptor and legacy tests within a single test invocation by achow101)

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.

@laanwj

laanwj commented Apr 5, 2022

Copy link
Copy Markdown
Member

Concept ACK, thanks for adding tests

Comment thread test/functional/tool_signet_miner.py Resolved
The path is stored in `self.options.bitcoinutil`, points to
`src/bitcoin-util` by default and can be overrided with the
`BITCOINUTIL` environment variable.
@theStack
theStack force-pushed the 202203-test-add_test_for_signet_miner branch from d1d98c2 to f8abc66 Compare April 11, 2022 20:03
@theStack

Copy link
Copy Markdown
Contributor Author

Force-pushed with preliminary commits integrating bitcoin-util into the test framework (storing its path to self.options.bitcoinutil, adding is_bitcoin_util_compiled/skip_if_no_bitcoin_util helpers depending on the test/config.ini entry), as suggested by @laanwj.

@laanwj

laanwj commented Apr 13, 2022 •

Copy link
Copy Markdown
Member

Code review ACK f8abc66ca16eb0c3a4fa2388b11b9bef3c8a297a
I've verified that the test gets run (and not skipped) in the various CI runs.

Comment thread test/functional/tool_signet_miner.py Resolved
@0xB10C

0xB10C commented Apr 13, 2022

Copy link
Copy Markdown
Contributor

Concert ACK!

@theStack
theStack force-pushed the 202203-test-add_test_for_signet_miner branch from f8abc66 to 038d2a6 Compare April 13, 2022 22:29
@theStack

Copy link
Copy Markdown
Contributor Author

Force-pushed with a simpler signet challenge (p2wpkh instead of 1-of-1 multisig that the descriptor wallet couldn't sign), the test can now be run with both legacy and descriptor wallet. Also removed the "works only with legacy wallet" part from the PR description accordingly.

@laanwj

laanwj commented Apr 14, 2022

Copy link
Copy Markdown
Member

re-ACK 038d2a6
Thanks for making the test work for the non-legacy wallet too.

@laanwj
laanwj merged commit cf0a8b9 into bitcoin:master Apr 14, 2022
@theStack
theStack deleted the 202203-test-add_test_for_signet_miner branch April 14, 2022 17:40
@bitcoin bitcoin locked and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants