Skip to content

Commit 6f5b027

Browse files
committed
add rpc unit tests in CI
1 parent 19e7b5f commit 6f5b027

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.github/workflows/cont_integration.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- compact_filters
2323
- esplora,key-value-db,electrum
2424
- compiler
25+
- rpc
2526
steps:
2627
- name: checkout
2728
uses: actions/checkout@v2
@@ -108,6 +109,19 @@ jobs:
108109
- name: Test
109110
run: $HOME/.cargo/bin/cargo test --features test-electrum --no-default-features
110111

112+
test-rpc:
113+
name: Test rpc
114+
runs-on: ubuntu-20.04
115+
env:
116+
BITCOIN_VER: 0.21.0
117+
steps:
118+
- name: Checkout
119+
uses: actions/checkout@v2
120+
- run: echo "BITCOIND_EXE=${{ github.workspace }}/bitcoin-${{ env.BITCOIN_VER }}/bin/bitcoind" >> $GITHUB_ENV
121+
- run: curl https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VER/bitcoin-$BITCOIN_VER-x86_64-linux-gnu.tar.gz | tar -xvz bitcoin-$BITCOIN_VER/bin/bitcoind
122+
- name: Test
123+
run: $HOME/.cargo/bin/cargo test --features test-electrum --no-default-features
124+
111125
check-wasm:
112126
name: Check WASM
113127
runs-on: ubuntu-16.04

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ rpc = ["bitcoincore-rpc"]
5959
# Debug/Test features
6060
debug-proc-macros = ["bdk-macros/debug", "bdk-testutils-macros/debug"]
6161
test-electrum = ["electrum"]
62+
test-rpc = ["rpc"]
6263
test-md-docs = ["electrum"]
6364

6465
[dev-dependencies]

src/blockchain/rpc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ fn list_wallet_dir(client: &Client) -> Result<Vec<String>, Error> {
314314
Ok(result.wallets.into_iter().map(|n| n.name).collect())
315315
}
316316

317+
#[cfg(feature = "test-rpc")]
317318
#[cfg(test)]
318319
mod test {
319320
use super::{RpcBlockchain, RpcConfig};

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub enum Error {
8888
/// requested network, for example what is given as bdk-cli option
8989
requested: Network,
9090
/// found network, for example the network of the bitcoin node
91-
found: Network
91+
found: Network,
9292
},
9393
/// Progress value must be between `0.0` (included) and `100.0` (included)
9494
InvalidProgressValue(f32),

0 commit comments

Comments
 (0)