Skip to content

Commit

Permalink
Merge ValuedMammal/bdk-kyoto#47: Test CI
Browse files Browse the repository at this point in the history
752486f ci: test ci (valued mammal)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: 88b3daccb10359fb6a16f26a60e369dd2a962ab85bd23cb09fa3f0a7bcffcbe98d6de1431239e542b8da17878900727392de78980c68608efa4fc62d1ee91a7c
  • Loading branch information
ValuedMammal committed Sep 10, 2024
2 parents d5bdfaa + 752486f commit ff57a06
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
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

0 comments on commit ff57a06

Please sign in to comment.