Skip to content

Add feature "22_0" for bitcoin 22.0 #30

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

Merged
merged 2 commits into from
Sep 20, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
feature: [ "0_21_1", "0_21_0", "0_20_1", "0_20_0", "0_19_1", "0_19_0_1", "0_18_1", "0_18_0", "0_17_1"]
feature: [ "22_0", "0_21_1", "0_21_0", "0_20_1", "0_20_0", "0_19_1", "0_19_0_1", "0_18_1", "0_18_0", "0_17_1"]
include:
- os: "macos-10.15"
feature: "0_21_1"
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ documentation = "https://docs.rs/bitcoind/"
edition = "2018"

[dependencies]
core-rpc = "0.14"
core-rpc = "0.15"
tempfile = "3.1"
log = "0.4"
home = "0.5.3" # use same ver in build-dep
Expand All @@ -24,6 +24,7 @@ flate2 = "1.0"
tar = "0.4"

[features]
"22_0" = []
"0_21_1" = []
"0_21_0" = []
"0_20_1" = []
Expand Down
14 changes: 13 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ fn download_filename() -> String {
}

fn get_expected_sha256(filename: &str) -> Result<sha256::Hash, ()> {
let sha256sums_filename = format!("sha256/bitcoin-core-{}-SHA256SUMS.asc", &VERSION);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use the .asc version also for 22.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't decide about this, starting with 22.0 two files are created: SHA256SUMS and SHA256SUMS.asc. The first file has all the checksums and the second file only has signatures. Two other options I see are:

  1. for all new releases of bitcoind we rename the SHA256SUMS file to SHA256SUMS.asc, but usually the .asc extension means that it's ascii armored which the new release files technically won't be.
  2. we rename all the files in the sha256 directory, removing the .asc extension and we should also remove the signatures so the file names won't be misleading and since we don't use the signatures anyway.

Disadvantage of options 1 is some misleading file naming that conflict with actual files released with that name. I'd prefer option 2 since going forward for new releases we can just rename and drop in the unedited SHA256SUMS file.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't know the SHA256SUMS.asc format changed... Let's keep it as it is in current PR

let sha256sums_filename = format!("sha256/bitcoin-core-{}-SHA256SUMS", &VERSION);
#[cfg(any(
feature = "0_21_1",
feature = "0_21_0",
feature = "0_20_1",
feature = "0_20_0",
feature = "0_19_1",
feature = "0_19_0_1",
feature = "0_18_1",
feature = "0_18_0",
feature = "0_17_1",
))]
let sha256sums_filename = format!("{}.asc", sha256sums_filename);
let file = File::open(sha256sums_filename).map_err(|_| ())?;
for line in BufReader::new(file).lines().flatten() {
let tokens: Vec<_> = line.split(" ").collect();
Expand Down
23 changes: 23 additions & 0 deletions sha256/bitcoin-core-22.0-SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
9547fa03574f8bde296f707c7d9f7d89827c75c5a28f84402578a4fa92a787ec bitcoin-22.0-aarch64-linux-gnu-debug.tar.gz
ac718fed08570a81b3587587872ad85a25173afa5f9fbbd0c03ba4d1714cfa3e bitcoin-22.0-aarch64-linux-gnu.tar.gz
80071e0ecd24edfec8a1972b495b9822c79a5d33c7123bff51688638aac97cab bitcoin-22.0-arm-linux-gnueabihf-debug.tar.gz
b8713c6c5f03f5258b54e9f436e2ed6d85449aa24c2c9972f91963d413e86311 bitcoin-22.0-arm-linux-gnueabihf.tar.gz
8f70852feb39078e02182563517d17bdfc4a12904cf1bdabbae95594d9a1e473 bitcoin-22.0-codesignatures-22.0.tar.gz
d0e9d089b57048b1555efa7cd5a63a7ed042482045f6f33402b1df425bf9613b bitcoin-22.0.tar.gz
bfc04a3c4e8b613bfd9359e54da6cc60f027860e9723f9a6bfd6f13873eb811f bitcoin-22.0-powerpc64-linux-gnu-debug.tar.gz
2cca5f99007d060aca9d8c7cbd035dfe2f040dd8200b210ce32cdf858479f70d bitcoin-22.0-powerpc64-linux-gnu.tar.gz
5f0bf1491bc8825ca1506f7cf586030f06bb17a563ccde92e8c75720022704e6 bitcoin-22.0-powerpc64le-linux-gnu-debug.tar.gz
91b1e012975c5a363b5b5fcc81b5b7495e86ff703ec8262d4b9afcfec633c30d bitcoin-22.0-powerpc64le-linux-gnu.tar.gz
59b16e63aa935f50fd2813efe7f137187fcf0fff84e3205a9c6cb462a8bb160c bitcoin-22.0-riscv64-linux-gnu-debug.tar.gz
9cc3a62c469fe57e11485fdd32c916f10ce7a2899299855a2e479256ff49ff3c bitcoin-22.0-riscv64-linux-gnu.tar.gz
3b3e2680f7d9304c13bfebaf6445ada40d72324b4b3e0a07de9db807389a6c5b bitcoin-22.0-osx-signed.dmg
52449aa894a6ce5653315e1260d0ce87c1d9f490afe3c92b44285710804b11ae bitcoin-22.0-osx-unsigned.dmg
f51156774c24c0ac5cc30237fa08aa17ed04a180dfd72c3e7d20fdc3f45806dc bitcoin-22.0-osx-unsigned.tar.gz
2744d199c3343b2d94faffdfb2c94d75a630ba27301a70e47b0ad30a7e0155e9 bitcoin-22.0-osx64.tar.gz
3a4f05657c048d3e9505bdb9c4fb3658e5e3d4233b0b93c1853e080620589765 bitcoin-22.0-x86_64-linux-gnu-debug.tar.gz
59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16 bitcoin-22.0-x86_64-linux-gnu.tar.gz
9169989d649937c0f9ebccd3ab088501328aa319fe9e91fc7ea8e8cf0fcccede bitcoin-22.0-win64-setup.exe
f890473d6d910d478f8ff08f9356d0305d19b46cf06e4fc3b5a49b0b684fd2a7 bitcoin-22.0-win-unsigned.tar.gz
0a97ebc8ae44913e3ef9c5b1ddd2af3a4ffb0ba25b6ab1ee8173e40e60499402 bitcoin-22.0-win64-debug.zip
ecc579d006230d6ffc5a5b7b53ce8c76477d37c1c7bad69694e9c2d69f00331d bitcoin-22.0-win64-setup-unsigned.exe
9485e4b52ed6cebfe474ab4d7d0c1be6d0bb879ba7246a8239326b2230a77eb1 bitcoin-22.0-win64.zip
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl BitcoinD {
// the call is succesfull not in the returned value.
if client_base.call::<Value>("getblockchaininfo", &[]).is_ok() {
client_base
.create_wallet("default", None, None, None, None)
.create_wallet("default", None, None, None, None, None)
.unwrap();
break Client::new(&node_url_default, Auth::CookieFile(cookie_file.clone()))
.unwrap();
Expand Down Expand Up @@ -248,7 +248,7 @@ impl BitcoinD {
pub fn create_wallet<T: AsRef<str>>(&self, wallet: T) -> Result<Client, Error> {
let _ = self
.client
.create_wallet(wallet.as_ref(), None, None, None, None)?;
.create_wallet(wallet.as_ref(), None, None, None, None, None)?;
Ok(Client::new(
&self.rpc_url_with_wallet(wallet),
Auth::CookieFile(self.params.cookie_file.clone()),
Expand Down
5 changes: 5 additions & 0 deletions src/versions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub const HAS_FEATURE: bool = cfg!(any(
feature = "22_0",
feature = "0_21_1",
feature = "0_21_0",
feature = "0_20_1",
Expand All @@ -11,6 +12,7 @@ pub const HAS_FEATURE: bool = cfg!(any(
));

#[cfg(not(any(
feature = "22_0",
feature = "0_21_1",
feature = "0_21_0",
feature = "0_20_1",
Expand All @@ -23,6 +25,9 @@ pub const HAS_FEATURE: bool = cfg!(any(
)))]
pub const VERSION: &str = "N/A";

#[cfg(feature = "22_0")]
pub const VERSION: &str = "22.0";

#[cfg(feature = "0_21_1")]
pub const VERSION: &str = "0.21.1";

Expand Down