Skip to content

Commit cd9b07b

Browse files
authored
Merge pull request #14 from Sjors/2026/03/mempool
ci: prepare wallet-capable integration test environment
2 parents b1fdd2d + f3f7319 commit cd9b07b

6 files changed

Lines changed: 563 additions & 375 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
- name: Build Bitcoin Core
3030
run: |
3131
cd bitcoin
32-
cmake -B build -DENABLE_WALLET=OFF -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
32+
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
3333
cmake --build build -j $(nproc)
3434
- name: Run Bitcoin Core Daemon
3535
run: cd bitcoin && ./build/bin/bitcoin node -chain=regtest -ipcbind=unix -server -debug=ipc -daemon
36-
- name: Generate Blocks
37-
run: cd bitcoin && ./build/bin/bitcoin rpc -regtest -rpcwait generatetodescriptor 101 "raw(51)"
3836
- name: Run Test Suite
37+
env:
38+
BITCOIN_BIN: ${{ github.workspace }}/bitcoin/build/bin/bitcoin
3939
run: cargo test

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ capnp = "0.25.0"
1818
capnpc = "0.25.0"
1919

2020
[dev-dependencies]
21+
bitcoin-primitives = { git = "https://github.com/rust-bitcoin/rust-bitcoin", package = "bitcoin-primitives", tag = "bitcoin-0.33.0-beta" }
2122
capnp-rpc = "0.25.0"
23+
encoding = { git = "https://github.com/rust-bitcoin/rust-bitcoin", package = "bitcoin-consensus-encoding", tag = "bitcoin-0.33.0-beta" }
2224
futures = "0.3.0"
25+
serde = { version = "1", features = ["derive"] }
26+
serde_json = "1"
2327
serial_test = "3"
2428
tokio = { version = "1", features = ["rt-multi-thread", "net", "macros", "io-util", "time"] }
2529
tokio-util = { version = "0.7.16", features = ["compat"] }

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The integration tests connect to a running bitcoin node via IPC.
4040

4141
```sh
4242
cd /path/to/bitcoin
43-
cmake -B build -DENABLE_WALLET=OFF -DBUILD_TESTS=OFF
43+
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF
4444
cmake --build build -j$(nproc)
4545
```
4646

@@ -50,23 +50,20 @@ cmake --build build -j$(nproc)
5050
./build/bin/bitcoin node -chain=regtest -ipcbind=unix -server -debug=ipc -daemon
5151
```
5252

53-
### 3. Generate blocks
53+
### 3. Run tests
5454

55-
The mining tests require chain height > 16. At height <= 16, `createNewBlock`
56-
fails with `bad-cb-length` because the BIP34 height push is too short for the
57-
coinbase scriptSig minimum.
55+
If `bitcoin` is not in your `PATH`, set `BITCOIN_BIN` to the full path of
56+
the Bitcoin Core binary.
5857

59-
```sh
60-
./build/bin/bitcoin rpc -chain=regtest -rpcwait generatetodescriptor 101 "raw(51)"
61-
```
62-
63-
### 4. Run tests
58+
The test harness bootstraps regtest chain state and ensures the test wallet is
59+
available before running integration tests.
6460

6561
```sh
62+
BITCOIN_BIN=./build/bin/bitcoin \
6663
cargo test
6764
```
6865

69-
### 5. Stop bitcoin
66+
### 4. Stop bitcoin
7067

7168
```sh
7269
./build/bin/bitcoin rpc -chain=regtest stop

0 commit comments

Comments
 (0)