Skip to content

Commit

Permalink
[ci] Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed Dec 21, 2023
1 parent 7d98b1a commit 8c85236
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
branches:
- master
pull_request:


# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check

clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features --tests

build-msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.54.0
- run: cargo build --release

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --release

doc-build:
name: doc-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --no-deps
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
`bdk_coin_select` is a tool to help you select inputs for making Bitcoin (ticker: BTC) transactions.
It's got zero dependencies so you can paste it into your project without concern.

> ⚠ This work is only ready to use by those who expect (potentially catastrophic) bugs and will have
> the time to investigate them and contribute back to this crate.
## Constructing the `CoinSelector`

The main structure is [`CoinSelector`](crate::CoinSelector). To construct it, we specify a list of
Expand Down
9 changes: 4 additions & 5 deletions src/coin_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ impl Candidate {
}
}

/// A structure that represents the weight costs of a drain (a.k.a. change) output.
/// Represents the weight costs of a drain (a.k.a. change) output.
///
/// This structure can also represent multiple outputs.
/// May also represent multiple outputs.
#[derive(Default, Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub struct DrainWeights {
/// The weight of including this drain output.
Expand Down Expand Up @@ -659,9 +659,8 @@ impl DrainWeights {
/// A drain (A.K.A. change) output.
/// Technically it could represent multiple outputs.
///
/// These are usually created by a [`change_policy`].
///
/// [`change_policy`]: crate::change_policy
/// This is returned from [`CoinSelector::drain`]. Note if `drain` returns a drain where `is_none()`
/// returns true then **no change should be added** to the transaction.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
pub struct Drain {
/// Weight of adding drain output and spending the drain output.
Expand Down

0 comments on commit 8c85236

Please sign in to comment.