diff --git a/Cargo.toml b/Cargo.toml index 950e733..cb58729 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,18 +2,19 @@ name = "bip322" version = "0.0.7" edition = "2021" -description = "Implements BIP322 generic message signing" +description = "Implements BIP322 generic message signing and verification" license = "CC0-1.0" homepage = "https://bip322.rs" repository = "https://github.com/raphjaph/bip322" +rust-version = "1.63" [dependencies] base64 = "0.22.1" -bitcoin = { version = "0.31.2" } +bitcoin = "0.31.2" bitcoin_hashes = "0.14.0" hex = "0.4.3" miniscript = "11.0.0" -snafu = "0.8.4" +snafu = { version = "0.8.4", default-features = false, features = ["rust_1_61", "std"] } [dev-dependencies] pretty_assertions = "1.4.0" diff --git a/README.md b/README.md index ef9ea73..775ccf2 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,7 @@ The WASM binary and Javascript glue code can then be found in `www/pkg`. The [bip322.rs](https://bip322.rs) site also runs a small WASM binary if you'd like to check it out. +## MSRV + +At the moment the Minimum Supported Rust Version (MSRV) is 1.63. You can check +it by running `just msrv`. diff --git a/justfile b/justfile index 706f4bb..a098120 100644 --- a/justfile +++ b/justfile @@ -20,6 +20,9 @@ outdated: coverage: cargo llvm-cov +msrv: + cargo msrv verify -- rustup run 1.63 cargo check + wasm: AR=/opt/homebrew/opt/llvm/bin/llvm-ar \ CC=/opt/homebrew/opt/llvm/bin/clang \ diff --git a/src/verify.rs b/src/verify.rs index 6c58957..2fb568e 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -100,7 +100,9 @@ fn verify_full_p2wpkh( return Err(Error::ToSignInvalid); } - let Some(witness) = to_sign.inputs[0].final_script_witness.clone() else { + let witness = if let Some(witness) = to_sign.inputs[0].final_script_witness.clone() { + witness + } else { return Err(Error::WitnessEmpty); }; @@ -182,7 +184,9 @@ fn verify_full_p2tr( return Err(Error::ToSignInvalid); } - let Some(witness) = to_sign.inputs[0].final_script_witness.clone() else { + let witness = if let Some(witness) = to_sign.inputs[0].final_script_witness.clone() { + witness + } else { return Err(Error::WitnessEmpty); };