Commit graph

118 commits

Author SHA1 Message Date
Tom Trevethan
404165ce94 Merge 5acf12bafe into merged_master (Bitcoin PR bitcoin/bitcoin#31583) 2026-04-14 01:09:03 +01:00
ivanlele
6386147d6d
Merge f640b323bd into merged_master (Bitcoin PR bitcoin/bitcoin#30723) 2026-03-24 17:14:04 +00:00
Tom Trevethan
c8515145fa Merge df241970a3 into merged_master (Bitcoin PR bitcoin/bitcoin#30554) 2026-03-11 00:30:13 +00:00
ivanlele
92d19a59d6
Merge efbf4e71ce into merged_master (Bitcoin PR bitcoin/bitcoin#29523) 2026-03-09 14:47:37 +00:00
ivanlele
273d7e2364
Merge f9486de6a9 into merged_master (Bitcoin PR bitcoin/bitcoin#30029) 2026-02-19 14:52:48 +00:00
Byron Hambly
0b1508bf01
ci: fix lint issues 2025-04-17 11:06:32 +02:00
Byron Hambly
a8c15ff245 Merge c0311b1dda into merged_master (Bitcoin PR bitcoin/bitcoin#27349) 2025-04-12 10:10:01 +02:00
Byron Hambly
b4405ba453 Merge e9262ea32a into merged_master (Bitcoin PR bitcoin/bitcoin#26750) 2025-03-31 16:37:52 +02:00
Byron Hambly
d11cdab5ae Merge 66c08e741d into merged_master (Bitcoin PR bitcoin/bitcoin#24865) 2025-03-31 09:12:26 +02:00
Sjors Provoost
4131f322ac
test: check difficulty adjustment using alternate mainnet 2025-01-22 12:31:46 +01:00
Sjors Provoost
c4f68c12e2
Use OP_0 for BIP34 padding in signet and tests
For blocks 1 through 15 the script_BIP34_coinbase_height appends OP_1
to comply with BIP34 and avoid bad-cb-length.

This is inconsistent with BlockAssembler::CreateNewBlock() which adds
OP_0 instead.

The utxo_total_supply fuzzer and MinerTestingSetup::Block also use OP_0.

Changing it is required to import the test vectors in the next commit.

It also ensures the test vectors can be regenerated using the CPU miner
at https://github.com/pooler/cpuminer without patches (it uses OP_0).

The same helper is used by the signet miner, so this will impact newly
bootstrapped signets.
2025-01-22 12:29:16 +01:00
Sjors Provoost
2a7bfebd5e
Add target to getblock(header) in RPC and REST 2025-01-22 12:04:02 +01:00
Sjors Provoost
7ddbed4f9f
rpc: add nBits to getmininginfo
Also expands nBits test coverage.
2025-01-22 11:29:06 +01:00
James Dorfman
0fff8eea05 Merge 5d68d6840d into merged_master (Bitcoin PR bitcoin/bitcoin#25364) 2024-10-09 05:20:03 +00:00
MarcoFalke
444421db69
test: [refactor] Fix E714 pycodestyle 2024-08-29 07:00:27 +02:00
MarcoFalke
fa46a1b74b
test: Avoid CScript() as default function argument
This does not cause any issues, because CScript in the tests are const.
However, this change allows to enable the
"function-call-in-default-argument (B008)" lint rule.
2024-07-31 15:19:10 +02:00
ismaelsadeeq
734076c6de [wallet, rpc]: add max_tx_weight to tx funding options
This allows a transaction's weight to be bound under a certain
weight if possible and desired. This can be beneficial for future
RBF attempts, or whenever a more restricted spend topology is
desired.

Co-authored-by: Greg Sanders <gsanders87@gmail.com>
2024-06-27 15:31:21 +01:00
ismaelsadeeq
af3c18169a [test]: remove duplicate WITNESS_SCALE_FACTOR 2024-05-03 10:30:50 +01:00
Byron Hambly
c53eb39edf Merge 807169e10b into merged_master (Bitcoin PR bitcoin/bitcoin#24035) 2023-06-20 09:57:58 +00:00
Byron Hambly
50957f3e4b Merge 26a1147ce5 into merged_master (Bitcoin PR bitcoin/bitcoin#23636) 2023-06-01 12:04:07 +00:00
Byron Hambly
bd68371fb6 Merge ffdab41f94 into merged_master (Bitcoin PR bitcoin/bitcoin#23474) 2023-05-26 10:32:04 +00:00
Byron Hambly
7e120e5e97 Merge ab25ef8c7f into merged_master (Bitcoin PR bitcoin/bitcoin#23305) 2023-05-16 10:18:11 +00:00
Byron Hambly
ee8f77f5b2 Merge 991753e4d5 into merged_master (Bitcoin PR bitcoin/bitcoin#23118) 2023-05-10 11:36:56 +00:00
Byron Hambly
13fb374543 Merge 8e9801bfc4 into merged_master (Bitcoin PR bitcoin/bitcoin#22818) 2023-04-24 07:13:42 +00:00
Byron Hambly
1acda7580c Merge adccbb380b into merged_master (Bitcoin PR bitcoin/bitcoin#21862) 2023-04-11 08:09:30 +00:00
Byron Hambly
4cc48afd88 Merge 0b5344b0d1 into merged_master (Bitcoin PR bitcoin/bitcoin#22632) 2023-04-09 06:06:34 +00:00
James Dorfman
62076b5b7e Merge f4328ebef5 into merged_master (Bitcoin PR bitcoin/bitcoin#22619) 2023-04-07 04:34:13 +00:00
Byron Hambly
570683e6ac Merge ad0fc453cc into merged_master (Bitcoin PR bitcoin/bitcoin#16333) 2023-04-06 11:43:11 +00:00
James Dorfman
ebc6e3967f Merge bb60960750 into merged_master (Bitcoin PR bitcoin/bitcoin#22593) 2023-04-03 20:34:45 +00:00
Byron Hambly
e17125c41b Merge f2e41d1109 into merged_master (Bitcoin PR bitcoin/bitcoin#22429) 2023-04-03 15:12:22 +02:00
ismaelsadeeq
e47ce42f67 refactor: use address_to_scriptpubkey to retrieve addresses scriptpubkey
This commit updates the code by replacing the RPC call used to
decode an address and retrieve its corresponding scriptpubkey
with the address_to_scriptpubkey function. address_to_scriptpubkey
function can now decode all addresses formats, which makes
it more efficient to use.
2023-03-28 16:58:16 +01:00
Glenn Willen
55a5e2f921 Merge 548ca1d3a5 into merged_master (Bitcoin PR bitcoin/bitcoin#22550) 2023-03-28 00:44:23 +00:00
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2022-12-24 23:49:50 +00:00
Aurèle Oulès
564b580bf0
test: Introduce MIN_BLOCKS_TO_KEEP constant 2022-12-15 09:53:51 +01:00
Aurèle Oulès
71d9a7c03b
test: Wallet imports on pruned nodes
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
Co-authored-by: Andreas Kouloumos <kouloumosa@gmail.com>
2022-12-15 09:53:50 +01:00
Ayush Sharma
50ba6697f3 remove unused functions
the functions `create_transaction()` and `create_raw_transaction()` were no longer used hence removed.
2022-06-24 18:04:48 +05:30
Sebastian Falbesoner
2f79786822 test: refactor: add constant for sequence number SEQUENCE_FINAL 2022-01-11 15:28:28 +01:00
MarcoFalke
fa551b3bdd
Remove GetAdjustedTime from init.cpp 2021-11-30 17:19:49 +01:00
MarcoFalke
fac23c2114
scripted-diff: Bump copyright headers
The previous diff touched most files in ./test/, so bump the headers to
avoid having to touch them again for a bump later.

-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2021-11-10 11:10:24 +01:00
Sebastian Falbesoner
4718897ce3 test: add script_util helper for creating bare multisig scripts 2021-10-26 14:51:18 +02:00
Sebastian Falbesoner
429b49378e test: introduce script_util helper for creating P2PK scripts 2021-09-29 14:09:14 +02:00
MarcoFalke
fa4db8671b
test: Activate all regtest softforks at height 1, unless overridden 2021-09-16 18:53:04 +02:00
Andrew Poelstra
36e5e2a7f1 Merge 9a154599fe into merged_master (Elements PR ElementsProject/elements#900)
Surprisingly easy to do. Almost all of the diff resolution was mechanically
  * replacing boost::variant with std::variant
  * replacing Optional with std::optional
     * then replacing `nullopt` with `std::nullopt`
  * updating the RPC functions for the new RPCArg::Default type
  * update the tests/ directory to make new (since 22) tests use arrays for
    createrawtransaction outputs
  * other ad-hoc changes to function parameters etc (not too many of these)

I had to "really" change the code in PrecomputePSBTData, which was introduced
in 22.0 and affected by PSET, but this function was like 8 lines long so it
was easy.

Reviewing the diff may be a bit difficult because of the mix of mechanical
changes and ad-hoc things. Probably the most straightforward thing to do
is to redo the merge, `sed -i` to fix the boost::variant and Optional stuff,
then diff the remaining conflicts against this commit.

TODO: grep for `blindpsbt` and you will see that this RPC is still referenced
in documentation and help text even though it was deleted. Need to fix this
in 0.21 in a separate PR.
2021-09-04 19:34:14 +00:00
MarcoFalke
faf7e485e9
Set regtest.BIP65Height = 111 to speed up tests 2021-08-26 11:08:24 +02:00
W. J. van der Laan
0b5344b0d1
Merge bitcoin/bitcoin#22632: test: Set regtest.BIP66Height = 102 to speed up tests
fafe896a0b test: Set regtest.BIP66Height = 102 to speed up tests (MarcoFalke)

Pull request description:

  No need to waste time by forcing creation of more than 1000 blocks to get the benefits of being able to test BIP 66. Also, reducing the height makes it more likely that (third-party) tests are conforming to BIP 66, which is enforced on mainnet for all new blocks.

ACKs for top commit:
  GeneFerneau:
    Concept + code review ACK [fafe896](https://github.com/bitcoin/bitcoin/pull/22632/commits/fafe896a0b870d85250927bd5374caf73d379468)
  0xB10C:
    crACK fafe896a0b
  laanwj:
    ACK fafe896a0b
  Zero-1729:
    tACK fafe896
  kristapsk:
    ACK fafe896a0b. Full functional test suite showed few second speed incrase on my laptop (although I didn't do proper benchmarking with multiple runs, just single `time ./test/functional/test_runner.py` on current master vs this PR).
  theStack:
    Tested ACK fafe896a0b
  hg333:
    tACK fafe896a0b

Tree-SHA512: 4bbee3c8587d612e74a59fde49b6439c1296f2fc27d3a7cf59a35e920f729fdd581c930290bd04def618f81412236676ddb99b4ceb4d80dfb9fd610b128a04b1
2021-08-10 16:18:26 +02:00
MarcoFalke
f4328ebef5
Merge bitcoin/bitcoin#22619: test: refactor: use consistent bytes <-> hex-string conversion in functional test framework
5a1bef60a0 test: refactor: remove binascii from test_framework (Zero-1729)

Pull request description:

  This PR continues the work started in PR #22593, regarding using the `bytes` built-in module. In this PR specifically, instances of `binascii`'s methods `hexlify`, `unhexlify`,  and `a2b_hex` have been replaced with the build-in `bytes` module's `hex` and `fromhex` methods where appropriate to make bytes <-> hex-string conversions consistent across the functional test files and test_framework.

  Additionally, certain changes made are based on the following assumption:

  ```
  bytes.hex(data) == binascii.hexlify(data).decode()
  bytes.hex(data).encode() == binascii.hexlify(data)
  ```

  Ran the functional tests to ensure behaviour is still consistent and changes didn't break existing tests.

  closes #22605

ACKs for top commit:
  theStack:
    Code-review ACK 5a1bef60a0 🔢

Tree-SHA512: 8f28076cf0580a0d02a156f3e1e94c9badd3d41c3fbdfb2b87cd8a761dde2c94faa5f4c448d6747b1ccc9111c3ef1a1d7b42a11c806b241fa0410b7529e2445f
2021-08-05 12:15:01 +02:00
MarcoFalke
fafe896a0b
test: Set regtest.BIP66Height = 102 to speed up tests 2021-08-05 12:08:33 +02:00
Zero-1729
5a1bef60a0
test: refactor: remove binascii from test_framework 2021-08-04 19:59:13 +01:00
MarcoFalke
ad0fc453cc
Merge bitcoin/bitcoin#16333: test: Set BIP34Height = 2 for regtest
222290f543 test: Set BIP34Height = 2 for regtest (MarcoFalke)
fac90c55be test: Create all blocks with version 4 or higher (MarcoFalke)

Pull request description:

  BIP34 is active on the current tip of mainnet, so all miners must obey it. It would be nice if it also was active in fresh regtest instances from the earliest time possible.

  I changed the BIP34 height to `2`, so that the block at height=1 may be used to mine a duplicate coinbase. (Needed to test mainnet behaviour)

  This pull is done in two commits:

  *  test: Create all blocks with version 4 or higher:
     Now that BIP34 is activated earlier, we need to create blocks with a higher version number. Just bump it to 4 instead of 2 to avoid having to bump it again later.

  *  test: Set BIP34Height = 2 for regtest:
     This fixes the BIP34 implementation in the tests (to match the one of the Core codebase) and updates the tests where needed

ACKs for top commit:
  ajtowns:
    ACK 222290f543
  jonatack:
    ACK 222290f543 tested and reviewed rebased to current master 5e213822f8
  theStack:
    Tested ACK 222290f543

Tree-SHA512: d69c637a62a64b8e87de8c7f0b305823d8f4d115c1852514b923625dbbcf9a4854b5bb3771ff41702ebf47c4c182a4442c6d7c0b9f282c95a34b83e56a73939b
2021-08-03 10:10:43 +02:00
Sebastian Falbesoner
ca6c154ef1 test: refactor: remove hex_str_to_bytes helper
Use the built-in class method bytes.fromhex() instead,
which is available since Python 3.0.
2021-08-01 19:26:51 +02:00