Skip to content
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

Bump MSRV to Rust 1.63.0 #27

Merged
merged 5 commits into from
Aug 22, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: ./contrib/test.sh

MSRV:
name: Test - 1.56.1 toolchain
name: Test - 1.63.0 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.56.1"
toolchain: "1.63.0"
- name: Running test script
env:
DO_NO_STD: true
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 @@ categories = ["cryptography::cryptocurrencies"]
keywords = [ "psbt", "bip-174", "bip174", "bip-370", "bip370"]
readme = "README.md"
edition = "2021"
rust-version = "1.56.1"
rust-version = "1.63.0"
exclude = ["tests", "contrib"]

[package.metadata.docs.rs]
Expand All @@ -20,6 +20,7 @@ rustdoc-args = ["--cfg", "docsrs"]
default = ["std"]
std = ["bitcoin/std"]
no-std = ["bitcoin/no-std", "core2"]
rand-std = ["bitcoin/rand-std"]
serde = ["actual-serde", "bitcoin/serde"]
base64 = ["bitcoin/base64"]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For now we more or less just follow the contribution guidelines of

### Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on **Rust 1.56.1**.
This library should always compile with any combination of features on **Rust 1.63.0**.

To build with the MSRV you will likely need to pin a bunch of dependencies, see `./contrib/test.sh`
for the current list.
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.56.1"
msrv = "1.63.0"
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mod prelude {
#[cfg(all(not(feature = "std"), not(test)))]
pub use alloc::{string::{String, ToString}, vec::Vec, boxed::Box, borrow::{Borrow, BorrowMut, Cow, ToOwned}, slice, rc};

#[cfg(all(not(feature = "std"), not(test), any(not(rust_v_1_60), target_has_atomic = "ptr")))]
#[cfg(all(not(feature = "std"), not(test), target_has_atomic = "ptr"))]
pub use alloc::sync;

#[cfg(any(feature = "std", test))]
Expand Down
2 changes: 1 addition & 1 deletion src/v0/bitcoin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ mod tests {
let secp = Secp256k1::new();

let sk = SecretKey::new(&mut thread_rng());
let priv_key = PrivateKey::new(sk, crate::Network::Regtest);
let priv_key = PrivateKey::new(sk, bitcoin::Network::Regtest);
let pk = PublicKey::from_private_key(&secp, &priv_key);

(priv_key, pk, secp)
Expand Down
6 changes: 6 additions & 0 deletions src/v0/miniscript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,9 @@ trait PsbtFields {
fn tap_key_origins(
&mut self,
) -> &mut BTreeMap<bitcoin::key::XOnlyPublicKey, (Vec<TapLeafHash>, bip32::KeySource)>;
#[allow(dead_code)]
fn proprietary(&mut self) -> &mut BTreeMap<raw::ProprietaryKey, Vec<u8>>;
#[allow(dead_code)]
fn unknown(&mut self) -> &mut BTreeMap<raw::Key, Vec<u8>>;

// `tap_tree` only appears in Output, so it's returned as an option of a mutable ref
Expand All @@ -1040,9 +1042,11 @@ impl PsbtFields for Input {
) -> &mut BTreeMap<bitcoin::key::XOnlyPublicKey, (Vec<TapLeafHash>, bip32::KeySource)> {
&mut self.tap_key_origins
}
#[allow(dead_code)]
fn proprietary(&mut self) -> &mut BTreeMap<raw::ProprietaryKey, Vec<u8>> {
&mut self.proprietary
}
#[allow(dead_code)]
fn unknown(&mut self) -> &mut BTreeMap<raw::Key, Vec<u8>> { &mut self.unknown }

fn tap_scripts(&mut self) -> Option<&mut BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>> {
Expand All @@ -1067,9 +1071,11 @@ impl PsbtFields for Output {
) -> &mut BTreeMap<bitcoin::key::XOnlyPublicKey, (Vec<TapLeafHash>, bip32::KeySource)> {
&mut self.tap_key_origins
}
#[allow(dead_code)]
fn proprietary(&mut self) -> &mut BTreeMap<raw::ProprietaryKey, Vec<u8>> {
&mut self.proprietary
}
#[allow(dead_code)]
fn unknown(&mut self) -> &mut BTreeMap<raw::Key, Vec<u8>> { &mut self.unknown }

fn tap_tree(&mut self) -> Option<&mut Option<taproot::TapTree>> { Some(&mut self.tap_tree) }
Expand Down
2 changes: 1 addition & 1 deletion src/v2/map/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl Input {
/// Returns true if this input has been finalized.
///
/// > It checks whether all inputs have complete scriptSigs and scriptWitnesses by checking for
/// the presence of 0x07 Finalized scriptSig and 0x08 Finalized scriptWitness typed records.
/// > the presence of 0x07 Finalized scriptSig and 0x08 Finalized scriptWitness typed records.
///
/// Therefore a finalized input must have both `final_script_sig` and `final_script_witness`
/// fields set. For legacy transactions the `final_script_witness` will be an empty [`Witness`].
Expand Down
4 changes: 2 additions & 2 deletions tests/bip174.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ fn finalize_psbt(mut psbt: Psbt) -> Psbt {
let sigs: Vec<_> = psbt.inputs[1].partial_sigs.values().collect();
let mut script_witness = Witness::new();
script_witness.push([]); // Push 0x00 to the stack.
script_witness.push(&sigs[1].to_vec());
script_witness.push(&sigs[0].to_vec());
script_witness.push(sigs[1].to_vec());
script_witness.push(sigs[0].to_vec());
script_witness.push(psbt.inputs[1].witness_script.clone().unwrap().as_bytes());

script_witness
Expand Down