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

Test CI #47

Merged
merged 1 commit into from
Sep 10, 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
35 changes: 20 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: cargo test --verbose
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
6 changes: 3 additions & 3 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand Down
Loading