Skip to content
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
39 changes: 39 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Prepare Rust Environment'
description: 'Setup Rust toolchain and install RBMT'
inputs:
toolchain:
description: 'Rust toolchain to use (nightly reads from nightly-version file)'
required: false
default: 'stable'
components:
description: 'Rust components to install (e.g., clippy, rustfmt)'
required: false
default: ''
runs:
using: "composite"
steps:
- name: "Determine toolchain"
id: toolchain
shell: bash
run: |
if [ "${{ inputs.toolchain }}" = "nightly" ]; then
TOOLCHAIN="$(cat nightly-version)"
else
TOOLCHAIN="${{ inputs.toolchain }}"
fi
echo "version=$TOOLCHAIN" >> $GITHUB_OUTPUT

- name: "Setup stable toolchain for RBMT"
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: "Install RBMT"
shell: bash
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev "$(cat rbmt-version)" cargo-rbmt

- name: "Setup requested toolchain"
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.toolchain.outputs.version }}
components: ${{ inputs.components }}
206 changes: 46 additions & 160 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ on: # yamllint disable-line rule:truthy
name: Continuous integration

jobs:
Prepare:
runs-on: ubuntu-24.04
outputs:
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Read nightly version"
id: read_toolchain
run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT

Stable: # 2 jobs, one per lock file.
name: Test - stable toolchain
runs-on: ubuntu-latest
Expand All @@ -29,231 +18,128 @@ jobs:
dep: [minimal, recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh stable
toolchain: stable
- name: "Run tests"
run: cargo rbmt test stable --lock-file ${{ matrix.dep }}

Nightly: # 2 jobs, one per lock file.
name: Test - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [minimal, recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh nightly
toolchain: nightly
- name: "Run tests"
run: cargo rbmt test nightly --lock-file ${{ matrix.dep }}

MSRV: # 2 jobs, one per lock file.
name: Test - 1.63.0 toolchain
name: Test - 1.74.0 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [minimal, recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- uses: actions/checkout@v6
- name: "Free disk space"
uses: endersonmenezes/free-disk-space@v3
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/prepare
with:
toolchain: "1.63.0"
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh msrv
toolchain: "1.74.0"
- name: "Run tests"
run: cargo rbmt test msrv --lock-file ${{ matrix.dep }}

Lint:
name: Lint - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Install clippy"
run: rustup component add clippy
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh lint
toolchain: nightly
components: clippy
- name: "Run lint"
run: cargo rbmt lint

Docs:
name: Docs - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docs
toolchain: stable
- name: "Build docs"
run: cargo rbmt docs

Docsrs:
name: Docs - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docsrs
toolchain: nightly
- name: "Build docs.rs docs"
run: cargo rbmt docsrs

Bench:
name: Bench - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: c3324024ced9bb1eb854397686919c3ff7d97e1e
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh bench
toolchain: nightly
- name: "Run bench"
run: cargo rbmt bench

Format: # 1 job, run cargo fmt directly.
name: Format - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Install rustfmt"
run: rustup component add rustfmt
toolchain: nightly
components: rustfmt
- name: "Check formatting"
run: cargo fmt --all -- --check

Integration: # 1 job for each bitcoind version we support.
name: Integration tests - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature:
[
"26_0",
"25_2",
"25_1",
"25_0",
"24_2",
"24_1",
"24_0_1",
"23_2",
"23_1",
"23_0",
"22_1",
"22_0",
"0_21_2",
"0_20_2",
"0_19_1",
"0_18_1",
"0_17_1",
]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v6
- uses: ./.github/actions/prepare
with:
toolchain: stable
- name: "Run integration tests"
run: cd bitcoind-tests && cargo test --features=${{ matrix.feature }}
run: cargo rbmt integration

Embedded:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Miniscript: a subset of Bitcoin Script designed for analysis"
keywords = [ "crypto", "bitcoin", "miniscript", "script" ]
readme = "README.md"
edition = "2021"
rust-version = "1.63.0"
rust-version = "1.74.0"

[features]
default = ["std"]
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build](https://github.com/rust-bitcoin/rust-miniscript/workflows/Continuous%20integration/badge.svg)](https://github.com/rust-bitcoin/rust-miniscript/actions)
[![Issues](https://img.shields.io/github/issues-raw/rust-bitcoin/rust-miniscript)](https://github.com/rust-bitcoin/rust-miniscript/issues)

**Minimum Supported Rust Version:** 1.63.0
**Minimum Supported Rust Version:** 1.74.0

# Miniscript

Expand Down Expand Up @@ -38,10 +38,7 @@ or in [the `examples/` directory](https://github.com/rust-bitcoin/rust-miniscrip

## Minimum Supported Rust Version (MSRV)

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

Some dependencies do not play nicely with our MSRV, if you are running the tests
you may need to pin some dependencies. See `./contrib/pin.sh` for current pinning.
This library should always compile with any combination of features on **Rust 1.64.0**.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions bitcoind-tests/tests/test_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn test_desc_satisfy(
let mut aux_rand = [0u8; 32];
rand::thread_rng().fill_bytes(&mut aux_rand);
let schnorr_sig =
secp.sign_schnorr_with_aux_rand(&msg, &internal_keypair.to_inner(), &aux_rand);
secp.sign_schnorr_with_aux_rand(&msg, &internal_keypair.to_keypair(), &aux_rand);
psbt.inputs[0].tap_key_sig =
Some(taproot::Signature { signature: schnorr_sig, sighash_type });
} else {
Expand Down Expand Up @@ -315,7 +315,7 @@ fn find_sks_ms<Ctx: ScriptContext>(
.iter_pk()
.filter_map(|pk| {
let i = pks.iter().position(|&x| x.to_public_key() == pk);
i.map(|idx| (sks[idx]))
i.map(|idx| sks[idx])
})
.collect();
sks
Expand Down
3 changes: 0 additions & 3 deletions clippy.toml

This file was deleted.

7 changes: 0 additions & 7 deletions contrib/pin.sh

This file was deleted.

Loading
Loading