Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
- name: Build Bitcoin Core
run: |
cd bitcoin
cmake -B build -DENABLE_WALLET=OFF -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build -j $(nproc)
- name: Run Bitcoin Core Daemon
run: cd bitcoin && ./build/bin/bitcoin node -chain=regtest -ipcbind=unix -server -debug=ipc -daemon
- name: Generate Blocks
run: cd bitcoin && ./build/bin/bitcoin rpc -regtest -rpcwait generatetodescriptor 101 "raw(51)"
- name: Run Test Suite
env:
BITCOIN_BIN: ${{ github.workspace }}/bitcoin/build/bin/bitcoin
run: cargo test
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ capnp = "0.25.0"
capnpc = "0.25.0"

[dev-dependencies]
bitcoin-primitives = { git = "https://github.com/rust-bitcoin/rust-bitcoin", package = "bitcoin-primitives", tag = "bitcoin-0.33.0-beta" }
capnp-rpc = "0.25.0"
encoding = { git = "https://github.com/rust-bitcoin/rust-bitcoin", package = "bitcoin-consensus-encoding", tag = "bitcoin-0.33.0-beta" }
futures = "0.3.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serial_test = "3"
tokio = { version = "1", features = ["rt-multi-thread", "net", "macros", "io-util", "time"] }
tokio-util = { version = "0.7.16", features = ["compat"] }
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The integration tests connect to a running bitcoin node via IPC.

```sh
cd /path/to/bitcoin
cmake -B build -DENABLE_WALLET=OFF -DBUILD_TESTS=OFF
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF
cmake --build build -j$(nproc)
```

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

### 3. Generate blocks
### 3. Run tests

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

```sh
./build/bin/bitcoin rpc -chain=regtest -rpcwait generatetodescriptor 101 "raw(51)"
```

### 4. Run tests
The test harness bootstraps regtest chain state and ensures the test wallet is
available before running integration tests.

```sh
BITCOIN_BIN=./build/bin/bitcoin \
cargo test
```

### 5. Stop bitcoin
### 4. Stop bitcoin

```sh
./build/bin/bitcoin rpc -chain=regtest stop
Expand Down
Loading
Loading