Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix circuits integration tests panic: "unwrap on None value" when EIP…
Browse files Browse the repository at this point in the history
…-4896 withdrawals==None (#1688)

### Description

Integration Tests have been failing since introduction of
#1369,
due to Option::Unwrap on None value, when eth_block.withdrawals==None.

### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Contents

- zkevm-circuits/zkevm-circuits/src/witness/block.rs

### Rationale
replace eth_block.withdrawals.clone().unwrap() with
eth_block.withdrawals.clone().unwrap_or_default()

### How Has This Been Tested?

https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/6968928576/job/18963801769
<hr>

### Issue

#1687
  • Loading branch information
AronisAt79 committed Nov 27, 2023
1 parent f07ca3d commit e39d55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zkevm-circuits/src/witness/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<F: Field> Block<F> {

/// Return the list of withdrawals of this block.
pub fn withdrawals(&self) -> Vec<Withdrawal> {
let eth_withdrawals = self.eth_block.withdrawals.clone().unwrap();
let eth_withdrawals = self.eth_block.withdrawals.clone().unwrap_or_default();
eth_withdrawals
.iter()
.map({
Expand Down

0 comments on commit e39d55c

Please sign in to comment.