Skip to content

Commit

Permalink
ci: disable clippy for non-master branches
Browse files Browse the repository at this point in the history
  • Loading branch information
rot256 committed Jul 11, 2024
1 parent da14f63 commit ffeef04
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 9 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
push:
branches:
- "!master"

pull_request:
branches:
- "!master"

jobs:
build-and-test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
components: rustfmt, clippy

- name: Run cargo test
run: cargo test --all-features

- name: Run cargo build
run: cargo build --all

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Build for wasm
run: cargo build --target wasm32-unknown-unknown

- name: Build release
run: cargo build --release

build-and-test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy

- name: Run cargo test
run: cargo test --all-features

- name: Run cargo build
run: cargo build --all

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Build release
run: cargo build --release
13 changes: 10 additions & 3 deletions .github/workflows/build.yml → .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
on: ["push", "pull_request"]
on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build-and-test-linux:
Expand Down Expand Up @@ -26,7 +33,7 @@ jobs:

- name: Build for wasm
run: cargo build --target wasm32-unknown-unknown

- name: Build release
run: cargo build --release

Expand All @@ -53,4 +60,4 @@ jobs:
run: cargo clippy --all -- -D warnings

- name: Build release
run: cargo build --release
run: cargo build --release
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Pumice

Pumice is a work-in-progress, portable, pure-rust,
reimplementation of the Starkware stone-prover.

## Contributions

Please adhere to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
11 changes: 5 additions & 6 deletions src/merkle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,17 @@ impl<F: Field, H: Hasher<F>> MerkleTree<F, H> {
((ROOT_IDX, hash), None) => break Some(hash),

// merge the node with its sibling
((idx, hash), Some((next_idx, next_hash))) if idx + 1 == next_idx => {
((idx, hash), Some((nxt_idx, nxt_hash))) => {
// retrieve the sibling of the node
let sibling_idx = idx ^ 1;
let sibling = match next_idx == sibling_idx {
true => next_hash,
let sibl = match nxt_idx == idx ^ 1 {
true => nxt_hash,
false => siblings.next()?,
};

// merge the node with its sibling
let nodes: [H::Output; 2] = match idx % 2 {
0 => [hash, sibling],
1 => [sibling, hash],
0 => [hash, sibl],
1 => [sibl, hash],
_ => unreachable!(),
};

Expand Down

0 comments on commit ffeef04

Please sign in to comment.