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

Fix serde feature gating in types #1082

Merged
merged 6 commits into from
Aug 25, 2023
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
8 changes: 8 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ci-check-nodejs = "check --manifest-path bindings/nodejs/Cargo.toml --all-target
ci-check-python = "check --manifest-path bindings/python/Cargo.toml --all-targets --lib"
ci-check-wasm = "check --manifest-path bindings/wasm/Cargo.toml --target wasm32-unknown-unknown --lib"
ci-check-nostd = "check --no-default-features -F serde -p iota-sdk --target riscv64gc-unknown-none-elf"
ci-check-types = "check --no-default-features -p iota-sdk"

ci-test = "nextest run --all-features --profile ci --cargo-profile ci -p iota-sdk -p iota-sdk-bindings-core"

Expand All @@ -14,3 +15,10 @@ ci-doc = "doc --all-features --no-deps --document-private-items"
ci-fmt = "fmt --all -- --check"
ci-toml = "sort --grouped --check"
ci-udeps = "udeps --all-targets --all-features --backend=depinfo"
ci-license = "license-template --template .license_template"

# The ignored security advisories:
#
# - RUSTSEC-2021-0065: https://rustsec.org/advisories/RUSTSEC-2021-0065
# - anymap is unmaintained 🤷‍♀️
ci-audit = "audit --file Cargo.lock --deny warnings --ignore RUSTSEC-2021-0065"
28 changes: 19 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
sudo apt-get install libudev-dev libusb-1.0-0-dev

- name: Run Cargo Udeps
run: cargo udeps --all-targets --all-features
run: cargo ci-udeps

check-format:
name: Check Format
Expand All @@ -112,10 +112,10 @@ jobs:
run: cargo install --force cargo-license-template

- name: Run Cargo Fmt
run: cargo fmt --all -- --check
run: cargo ci-fmt

- name: Run cargo-license-template
run: cargo license-template --template .license_template
run: cargo ci-license

audit:
name: Perform Security Audit
Expand All @@ -132,11 +132,7 @@ jobs:
install: cargo-audit

- name: Run Cargo Audit
# The ignored security advisories:
#
# - RUSTSEC-2021-0065: https://rustsec.org/advisories/RUSTSEC-2021-0065
# - anymap is unmaintained 🤷‍♀️
run: cargo audit --file Cargo.lock --deny warnings --ignore RUSTSEC-2021-0145 --ignore RUSTSEC-2021-0065
run: cargo ci-audit

no_std:
name: Check `no_std` compatability
Expand All @@ -152,4 +148,18 @@ jobs:
targets: riscv64gc-unknown-none-elf

- name: Check
run: cargo check --no-default-features -F serde -p iota-sdk --target=riscv64gc-unknown-none-elf
run: cargo ci-check-nostd

types:
name: Check types-only compilation
runs-on: ubuntu-latest

steps:
- name: Checkout the Source Code
uses: actions/checkout@v3

- name: Set up Rust
uses: ./.github/actions/setup-rust

- name: Check
run: cargo ci-check-types
2 changes: 1 addition & 1 deletion sdk/src/client/secret/ledger_nano.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ fn merge_unlocks(
// address already at this point, because the reference index needs to be lower
// than the current block index
if !input_address.is_ed25519() {
return Err(Error::MissingInputWithEd25519Address)?;
return Err(Error::MissingInputWithEd25519Address);
}

let unlock = unlocks.next().ok_or(Error::MissingInputWithEd25519Address)?;
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/pow/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl MinerBuilder {
pub fn finish(self) -> Miner {
Miner {
num_workers: self.num_workers.unwrap_or_else(num_cpus::get),
cancel: self.cancel.unwrap_or_else(MinerCancel::new),
cancel: self.cancel.unwrap_or_default(),
}
}
}
Expand Down
Loading
Loading