Skip to content

Commit 15fc8d6

Browse files
authored
Merge pull request #463 from gregdhill/refactor/vault-light
Refactor/vault light
2 parents 95f96e6 + 5bd1968 commit 15fc8d6

19 files changed

Lines changed: 866 additions & 283 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export BITCOIN_RPC_URL=http://localhost:18443
22
export BITCOIN_RPC_USER=rpcuser
33
export BITCOIN_RPC_PASS=rpcpassword
4+
export ELECTRS_URL=http://localhost:3002

.github/workflows/cargo-test.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ jobs:
1717
test:
1818
name: Test Suite
1919
runs-on: [self-hosted, linux]
20-
services:
21-
bitcoind:
22-
image: docker.io/interlayhq/bitcoin-core:22.0
23-
ports:
24-
- 18443:18443
2520

2621
strategy:
2722
matrix:
@@ -60,9 +55,11 @@ jobs:
6055
env:
6156
RUST_LOG: info,regalloc=warn
6257
BITCOIN_RPC_URL: http://127.0.0.1:18443
63-
BITCOIN_RPC_USER: user
64-
BITCOIN_RPC_PASS: pass
58+
BITCOIN_RPC_USER: rpcuser
59+
BITCOIN_RPC_PASS: rpcpassword
60+
ELECTRS_URL: http://localhost:3002
6561
run: |
62+
docker-compose up --detach
6663
cargo test --release --workspace --features ${{ matrix.metadata }} --features uses-bitcoind
6764
- name: build
6865
run: |

Cargo.lock

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bitcoin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ num-derive = "0.3"
2525
futures = "0.3.5"
2626
log = "0.4.0"
2727
hyper = "0.10"
28-
esplora-btc-api = "1.0.3"
2928
sha2 = "0.8.2"
3029
cfg-if = "1.0"
3130

@@ -42,3 +41,4 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-
4241
mockall = "0.8.1"
4342
regex = "1.4.3"
4443
rand = "0.7"
44+
serial_test = "*"

bitcoin/src/electrs/error.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use bitcoincore_rpc::bitcoin::{
22
consensus::encode::Error as BitcoinEncodeError, hashes::hex::Error as HexError,
33
util::address::Error as BitcoinAddressError,
44
};
5-
use reqwest::Error as ReqwestError;
5+
use reqwest::{Error as ReqwestError, StatusCode};
66
use serde_json::Error as SerdeJsonError;
77
use std::num::{ParseIntError, TryFromIntError};
88
use thiserror::Error;
@@ -36,3 +36,9 @@ pub enum Error {
3636
#[error("ParseIntError: {0}")]
3737
ParseIntError(#[from] ParseIntError),
3838
}
39+
40+
impl Error {
41+
pub fn is_not_found(&self) -> bool {
42+
matches!(self, Error::ReqwestError(err) if err.status().contains(&StatusCode::NOT_FOUND))
43+
}
44+
}

0 commit comments

Comments
 (0)