From 752486fc89763973c142077134132eb6bf2413e6 Mon Sep 17 00:00:00 2001 From: valued mammal Date: Mon, 9 Sep 2024 21:54:10 -0400 Subject: [PATCH] ci: test ci --- .github/workflows/ci.yml | 35 ++++++++++++++++++++--------------- Cargo.toml | 1 + tests/client.rs | 6 +++--- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54cdd84..c136436 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,29 +8,34 @@ on: jobs: build: + runs-on: ubuntu-latest strategy: matrix: - platform: [ubuntu-latest] - toolchain: [stable] - include: + rust: + - toolchain: stable - toolchain: 1.63.0 - msrv: true - runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v3 - - name: Update Toolchain + - name: Checkout + uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust.toolchain }} + components: clippy, rustfmt + - name: Pin dependencies for MSRV + if: matrix.rust.toolchain == '1.63.0' run: | - rustup default ${{ matrix.toolchain }} - rustup component add --toolchain ${{ matrix.toolchain }} rustfmt - rustup component add --toolchain ${{ matrix.toolchain }} clippy - rustup update ${{ matrix.toolchain }} + cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5" + cargo update -p time --precise "0.3.20" + cargo update -p home --precise "0.5.5" + cargo update -p tokio --precise "1.37.0" - name: Lint all targets - run: cargo clippy + run: cargo clippy --all-targets - name: Format run: cargo fmt -- --check - - name: Build with defeault features + - name: Build with default features run: cargo build --verbose - - name: Check release build on Rust ${{ matrix.toolchain }} + - name: Check release build on Rust ${{ matrix.rust.toolchain }} run: cargo check --release --verbose --color always - name: Test - run: cargo test --verbose \ No newline at end of file + run: cargo test --verbose diff --git a/Cargo.toml b/Cargo.toml index b7b53a6..344dea0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "bdk_kyoto" version = "0.1.0" edition = "2021" +rust-version = "1.63.0" [dependencies] bdk_chain = { version = "0.18.0" } diff --git a/tests/client.rs b/tests/client.rs index c060ba7..0362e01 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -96,7 +96,7 @@ async fn update_returns_blockchain_data() -> anyhow::Result<()> { } = res; // graph tx and anchor let tx = tx_update.txs.first().unwrap(); - let (anchor, anchor_txid) = *tx_update.anchors.first().unwrap(); + let (anchor, anchor_txid) = *tx_update.anchors.iter().next().unwrap(); assert_eq!(anchor_txid, txid); assert_eq!(anchor.block_id.height, 102); assert_eq!(anchor.block_id.hash, hashes[0]); @@ -147,7 +147,7 @@ async fn update_handles_reorg() -> anyhow::Result<()> { // get update let logger = PrintLogger::new(); let res = client.update(&logger).await.expect("should have update"); - let (anchor, anchor_txid) = *res.tx_update.anchors.first().unwrap(); + let (anchor, anchor_txid) = *res.tx_update.anchors.iter().next().unwrap(); assert_eq!(anchor.block_id.hash, blockhash); assert_eq!(anchor_txid, txid); @@ -159,7 +159,7 @@ async fn update_handles_reorg() -> anyhow::Result<()> { // expect tx to confirm at same height but different blockhash let res = client.update(&logger).await.expect("should have update"); - let (anchor, anchor_txid) = *res.tx_update.anchors.first().unwrap(); + let (anchor, anchor_txid) = *res.tx_update.anchors.iter().next().unwrap(); assert_eq!(anchor_txid, txid); assert_eq!(anchor.block_id.height, 102); assert_ne!(anchor.block_id.hash, blockhash);