Skip to content

Commit 5484961

Browse files
committed
Upgrade corepc crates (with custom patches)
On upstream `corepc-client` was bumped to `v0.13.0` and `corepc-node` crate renamed to `bitcoind`. Bump rev to `8798e7f` on b10c's fork and adjust references to `corepc_node`/`Node` in the codebase accordingly. Cargo.lock is regenerated to satisfy `bitreq 0.3.5`. references to `corepc-node` in the codebase to the new name.
1 parent a8ab455 commit 5484961

9 files changed

Lines changed: 84 additions & 121 deletions

File tree

Cargo.lock

Lines changed: 41 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extractors/log/tests/integration.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use log_extractor::Args;
55
use shared::{
66
async_nats,
77
bitcoin::{Block, consensus::Decodable, hashes::Hash, hex::FromHex},
8-
corepc_node,
8+
bitcoind,
99
futures::StreamExt,
1010
log::{Level, LevelFilter, info},
1111
nats_util::NatsArgs,
@@ -128,19 +128,19 @@ fn make_test_args(nats_port: u16, bitcoind_pipe: String) -> Args {
128128
/// Starts a regtest `bitcoind` node with the given configuration.
129129
///
130130
/// The binary is resolved from the `BITCOIND_EXE` environment variable
131-
/// (via `corepc_node::exe_path`); if unset, a pre-built binary is
131+
/// (via `bitcoind::exe_path`); if unset, a pre-built binary is
132132
/// downloaded automatically.
133-
fn setup_node(conf: corepc_node::Conf) -> corepc_node::Node {
133+
fn setup_node(conf: bitcoind::Conf) -> bitcoind::BitcoinD {
134134
info!("env BITCOIND_EXE={:?}", std::env::var("BITCOIND_EXE"));
135-
info!("exe_path={:?}", corepc_node::exe_path());
135+
info!("exe_path={:?}", bitcoind::exe_path());
136136

137-
if let Ok(exe_path) = corepc_node::exe_path() {
137+
if let Ok(exe_path) = bitcoind::exe_path() {
138138
info!("Using bitcoind at '{}'", exe_path);
139-
return corepc_node::Node::with_conf(exe_path, &conf).unwrap();
139+
return bitcoind::BitcoinD::with_conf(exe_path, &conf).unwrap();
140140
}
141141

142142
info!("Trying to download a bitcoind..");
143-
corepc_node::Node::from_downloaded_with_conf(&conf).unwrap()
143+
bitcoind::BitcoinD::from_downloaded_with_conf(&conf).unwrap()
144144
}
145145

146146
/// Creates a two-node regtest topology:
@@ -149,18 +149,18 @@ fn setup_node(conf: corepc_node::Conf) -> corepc_node::Node {
149149
///
150150
/// `node1_args` are appended as extra `bitcoind` CLI flags (e.g. `-debug=validation`) so tests
151151
/// can enable the specific logging needed to trigger the events they want to observe.
152-
fn setup_two_connected_nodes(node1_args: Vec<&str>) -> (corepc_node::Node, corepc_node::Node) {
152+
fn setup_two_connected_nodes(node1_args: Vec<&str>) -> (bitcoind::BitcoinD, bitcoind::BitcoinD) {
153153
// node1 listens for p2p connections
154-
let mut node1_conf = corepc_node::Conf::default();
155-
node1_conf.p2p = corepc_node::P2P::Yes;
154+
let mut node1_conf = bitcoind::Conf::default();
155+
node1_conf.p2p = bitcoind::P2P::Yes;
156156
for arg in node1_args {
157157
info!("Running node1 with arg: {}", arg);
158158
node1_conf.args.push(arg);
159159
}
160160
let node1 = setup_node(node1_conf);
161161

162162
// node2 connects to node1
163-
let mut node2_conf = corepc_node::Conf::default();
163+
let mut node2_conf = bitcoind::Conf::default();
164164
node2_conf.p2p = node1.p2p_connect(true).unwrap();
165165
let node2 = setup_node(node2_conf);
166166

@@ -193,7 +193,7 @@ fn setup_two_connected_nodes(node1_args: Vec<&str>) -> (corepc_node::Node, corep
193193
/// exit before returning.
194194
async fn check(
195195
args: Vec<&str>,
196-
test_setup: fn(&corepc_node::Client),
196+
test_setup: fn(&bitcoind::Client),
197197
check_event: fn(PeerObserverEvent) -> bool,
198198
) {
199199
setup();

extractors/p2p/tests/integration.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use shared::{
55
async_nats,
66
bitcoin::{self, Amount},
7-
corepc_node::{self},
7+
bitcoind::{self},
88
futures::StreamExt,
99
log::{self, info},
1010
nats_util::NatsArgs,
@@ -72,21 +72,21 @@ fn make_test_args(
7272
)
7373
}
7474

75-
fn setup_node(conf: corepc_node::Conf) -> corepc_node::Node {
75+
fn setup_node(conf: bitcoind::Conf) -> bitcoind::BitcoinD {
7676
info!("env BITCOIND_EXE={:?}", std::env::var("BITCOIND_EXE"));
77-
info!("exe_path={:?}", corepc_node::exe_path());
77+
info!("exe_path={:?}", bitcoind::exe_path());
7878

79-
if let Ok(exe_path) = corepc_node::exe_path() {
79+
if let Ok(exe_path) = bitcoind::exe_path() {
8080
info!("Using bitcoind at '{}'", exe_path);
81-
return corepc_node::Node::with_conf(exe_path, &conf).unwrap();
81+
return bitcoind::BitcoinD::with_conf(exe_path, &conf).unwrap();
8282
}
8383

8484
info!("Trying to download a bitcoind..");
85-
corepc_node::Node::from_downloaded_with_conf(&conf).unwrap()
85+
bitcoind::BitcoinD::from_downloaded_with_conf(&conf).unwrap()
8686
}
8787

88-
fn configure_node() -> corepc_node::Node {
89-
let mut node_conf = corepc_node::Conf::default();
88+
fn configure_node() -> bitcoind::BitcoinD {
89+
let mut node_conf = bitcoind::Conf::default();
9090
node_conf.args = vec![
9191
"-regtest",
9292
"-debug=net",
@@ -100,7 +100,7 @@ fn configure_node() -> corepc_node::Node {
100100
// enabling this is useful for debugging, but enabling this by default will
101101
// be quite spammy.
102102
node_conf.view_stdout = false;
103-
node_conf.p2p = corepc_node::P2P::Yes;
103+
node_conf.p2p = bitcoind::P2P::Yes;
104104

105105
setup_node(node_conf)
106106
}
@@ -110,7 +110,7 @@ async fn check(
110110
disable_addrv2: bool,
111111
disable_invs: bool,
112112
disable_feefilter: bool,
113-
test_setup: fn(&corepc_node::Node),
113+
test_setup: fn(&bitcoind::BitcoinD),
114114
mut check_expected: impl FnMut(PeerObserverEvent) -> bool,
115115
) {
116116
setup();

extractors/rpc/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
use shared::bitcoind::mtype::{
2+
GetBlockchainInfo, GetChainTxStats, GetNetworkInfo, GetOrphanTxsVerboseTwo,
3+
};
14
use shared::clap::{ArgGroup, Parser};
25
use shared::corepc_client::client_sync::Auth;
36
use shared::corepc_client::client_sync::v30::{Client, FeeEstimateMode};
4-
use shared::corepc_node::mtype::{
5-
GetBlockchainInfo, GetChainTxStats, GetNetworkInfo, GetOrphanTxsVerboseTwo,
6-
};
77
use shared::log;
88
use shared::nats_subjects::Subject;
99
use shared::nats_util::{self, NatsArgs};

extractors/rpc/tests/common/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use shared::{
2-
corepc_node,
2+
bitcoind,
33
log::{self, info},
44
nats_util::NatsArgs,
55
simple_logger::SimpleLogger,
@@ -148,27 +148,27 @@ pub fn make_test_args(
148148
)
149149
}
150150

151-
pub fn setup_node(conf: corepc_node::Conf) -> corepc_node::Node {
151+
pub fn setup_node(conf: bitcoind::Conf) -> bitcoind::BitcoinD {
152152
info!("env BITCOIND_EXE={:?}", std::env::var("BITCOIND_EXE"));
153-
info!("exe_path={:?}", corepc_node::exe_path());
153+
info!("exe_path={:?}", bitcoind::exe_path());
154154

155-
if let Ok(exe_path) = corepc_node::exe_path() {
155+
if let Ok(exe_path) = bitcoind::exe_path() {
156156
info!("Using bitcoind at '{}'", exe_path);
157-
return corepc_node::Node::with_conf(exe_path, &conf).unwrap();
157+
return bitcoind::BitcoinD::with_conf(exe_path, &conf).unwrap();
158158
}
159159

160160
info!("Trying to download a bitcoind..");
161-
corepc_node::Node::from_downloaded_with_conf(&conf).unwrap()
161+
bitcoind::BitcoinD::from_downloaded_with_conf(&conf).unwrap()
162162
}
163163

164-
pub fn setup_two_connected_nodes() -> (corepc_node::Node, corepc_node::Node) {
164+
pub fn setup_two_connected_nodes() -> (bitcoind::BitcoinD, bitcoind::BitcoinD) {
165165
// node1 listens for p2p connections
166-
let mut node1_conf = corepc_node::Conf::default();
167-
node1_conf.p2p = corepc_node::P2P::Yes;
166+
let mut node1_conf = bitcoind::Conf::default();
167+
node1_conf.p2p = bitcoind::P2P::Yes;
168168
let node1 = setup_node(node1_conf);
169169

170170
// node2 connects to node1
171-
let mut node2_conf = corepc_node::Conf::default();
171+
let mut node2_conf = bitcoind::Conf::default();
172172
node2_conf.p2p = node1.p2p_connect(true).unwrap();
173173
let node2 = setup_node(node2_conf);
174174

0 commit comments

Comments
 (0)