Skip to content

Commit

Permalink
fix tx_convert in witness (#261)
Browse files Browse the repository at this point in the history
* fix tx_convert in witness

* simplify code
  • Loading branch information
lispc committed Jan 5, 2022
1 parent 962bb76 commit 0c9cf1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bus-mapping/src/eth_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ pub struct GethExecTrace {

/// Truncate the memory in each step to the memory size before the step is
/// executed (and before the memory is expanded). This is required because geth
/// sets the memory in each step as the memroy before execution but after
/// sets the memory in each step as the memory before execution but after
/// expansion.
pub fn fix_geth_trace_memory_size(trace: &mut [GethExecStep]) {
let mut mem_sizes = vec![0; trace.len()];
Expand Down
13 changes: 7 additions & 6 deletions zkevm-circuits/src/evm_circuit/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ fn tx_convert(
tx: &bus_mapping::circuit_input_builder::Transaction,
ops_len: (usize, usize, usize),
) -> Transaction<Fp> {
let mut result: Transaction<Fp> = Transaction::<Fp> {
Transaction::<Fp> {
calls: vec![Call {
id: 1,
is_root: true,
Expand All @@ -414,12 +414,13 @@ fn tx_convert(
randomness,
),
}],
steps: tx
.steps()
.iter()
.map(|step| step_convert(step, ops_len))
.collect(),
..Default::default()
};
let _ = tx.steps().iter().map(|step| {
result.steps.push(step_convert(step, ops_len));
});
result
}
}

pub fn block_convert(
Expand Down

0 comments on commit 0c9cf1c

Please sign in to comment.