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

feat: expand trace decoder tests #394

Merged
merged 12 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

test_trace_decoder:
name: Test trace_decoder
runs-on: ubuntu-latest
runs-on: zero-ci
atanmarko marked this conversation as resolved.
Show resolved Hide resolved
timeout-minutes: 30
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
Expand All @@ -61,10 +61,9 @@ jobs:
cache-on-failure: true

- name: Test in trace_decoder subdirectory
run: cargo test --manifest-path trace_decoder/Cargo.toml
run: cargo test --release --manifest-path trace_decoder/Cargo.toml -- --nocapture
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
RUST_LOG: 1
RUST_LOG: info
CARGO_INCREMENTAL: 1
RUST_BACKTRACE: 1

Expand Down
141 changes: 123 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions trace_decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ winnow = { workspace = true }
criterion = { workspace = true }
pretty_env_logger = { workspace = true }
serde_json = { workspace = true }
prover = { workspace = true }
serde_path_to_error = { workspace = true }
plonky2_maybe_rayon = { workspace = true }
alloy-rpc-types-eth = "0.1.4"
rstest = "0.21.0"


[[bench]]
name = "block_processing"
Expand Down
16 changes: 10 additions & 6 deletions trace_decoder/src/type1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,13 @@ fn iter_leaves(node: Node) -> Box<dyn Iterator<Item = (Vec<U4>, IterLeaf)>> {
}

#[test]
fn test() {
for (ix, case) in
serde_json::from_str::<Vec<super::Case>>(include_str!("test_cases/zero_jerigon.json"))
.unwrap()
.into_iter()
.enumerate()
fn test_tries() {
for (ix, case) in serde_json::from_str::<Vec<super::Case>>(include_str!(
"../tests/data/tries/zero_jerigon.json"
))
.unwrap()
.into_iter()
.enumerate()
{
println!("case {}", ix);
let instructions = crate::wire::parse(&case.bytes).unwrap();
Expand All @@ -454,3 +455,6 @@ fn test() {
}
}
}

#[test]
fn test_witness_processing() {}
atanmarko marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 7 additions & 6 deletions trace_decoder/src/type2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,13 @@ fn iter_leaves(node: Node) -> Box<dyn Iterator<Item = (BitVec, Either<[u8; 32],
}

#[test]
fn test() {
for (ix, case) in
serde_json::from_str::<Vec<super::Case>>(include_str!("test_cases/hermez_cdk_erigon.json"))
.unwrap()
.into_iter()
.enumerate()
fn test_tries() {
for (ix, case) in serde_json::from_str::<Vec<super::Case>>(include_str!(
"../tests/data/tries/hermez_cdk_erigon.json"
))
.unwrap()
.into_iter()
.enumerate()
{
println!("case {}", ix);
let instructions = crate::wire::parse(&case.bytes).unwrap();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading