Skip to content

Allow selecting bitcoin version wip #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 13 additions & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,26 @@ name = "bitcoincore_rpc_async"
path = "src/lib.rs"

[dependencies]
bitcoincore-rpc-json-async = { version = "4.0.0-alpha.0", path = "../json"}
async-trait = "0.1.42"
log = "0.4.5"
jsonrpc-async = {version="2.0.2"}


[dependencies.bitcoincore-rpc-json-async]
version = "4.0.0-alpha.0"
path = "../json"
default-features = false

# Used for deserialization of JSON.
serde = "1"
serde_json = "1.0.61"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }


[features]
default = ["main"]
main = ["bitcoincore-rpc-json-async/main"]
sapio = ["bitcoincore-rpc-json-async/sapio"]

1 change: 0 additions & 1 deletion integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ publish=false

[dependencies]
bitcoincore-rpc-async = { path = "../client" }
bitcoin = { version = "0.28.0-rc.3", features = [ "use-serde", "rand" ], package = "sapio-bitcoin" }
lazy_static = "1.4.0"
log = "0.4"
tokio = { version = "1", features = ["full"] }
1 change: 1 addition & 0 deletions integration_test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use std::collections::HashMap;

use bitcoincore_rpc_async as bitcoincore_rpc;
use bitcoincore_rpc::json;
use bitcoincore_rpc::json::bitcoin;
use bitcoincore_rpc::jsonrpc::error::Error as JsonRpcError;
use bitcoincore_rpc::{Auth, Client, Error, RpcApi};

Expand Down
8 changes: 7 additions & 1 deletion json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@ serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
hex = "0.3"

bitcoin = { package = "sapio-bitcoin", version = "0.28.0-rc.3", features = [ "use-serde" ] }
sapio-bitcoin = { package = "sapio-bitcoin", version = "0.28.1", features = [ "use-serde" ], optional=true }
main-bitcoin = { package = "bitcoin", version = "0.28.2", features = [ "use-serde" ], optional=true }

[features]
default = ["main"]
sapio = ["sapio-bitcoin"]
main = ["main-bitcoin"]
13 changes: 12 additions & 1 deletion json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@


use std::collections::HashMap;
pub use bitcoin;

#[cfg(all(feature = "main", feature = "sapio"))]
compile_error!("features `crate/main` and `crate/sapio` are mutually exclusive");

#[cfg(not(any(feature = "main", feature = "sapio")))]
compile_error!("one of `crate/main` or `crate/sapio` must be set");

#[cfg(feature = "sapio")]
pub use sapio_bitcoin as bitcoin;

#[cfg(feature = "main")]
pub use main_bitcoin as bitcoin;

use bitcoin::consensus::encode;
use bitcoin::hashes::hex::{FromHex, ToHex};
Expand Down