# Week 16 and 17
Majority of these weeks were spent on fixing some of the bugs we had in our code.
# Fixing all the tests:
So along with all the previous tests we now have self-destruct, eip-2930, eip-7702 and read-only-opcodes and oog tests. While our implementation passed a lots of tests without changing, some were failing. I was working on tapping the cases which has out of gas issue.
Rimeeeeee initially added some logs to decode the result. This gave us some idea what exactly needed to be done. So I added a match arm and checked for out of gas.
```rust
if let Some(halt_reason) = &halt_reason {
if *halt_reason
== <E as Evm>::HaltReason::from(HaltReason::OutOfGas(
revm::context::result::OutOfGasError::Basic,
))
|| *halt_reason
== <E as Evm>::HaltReason::from(HaltReason::OutOfGas(
revm::context::result::OutOfGasError::MemoryLimit,
))
|| *halt_reason
== <E as Evm>::HaltReason::from(HaltReason::OutOfGas(
revm::context::result::OutOfGasError::Memory,
))
|| *halt_reason
== <E as Evm>::HaltReason::from(HaltReason::OutOfGas(
revm::context::result::OutOfGasError::Precompile,
))
|| *halt_reason
== <E as Evm>::HaltReason::from(HaltReason::OutOfGas(
revm::context::result::OutOfGasError::InvalidOperand,
))
|| *halt_reason
== <E as Evm>::HaltReason::from(HaltReason::OutOfGas(
revm::context::result::OutOfGasError::ReentrancySentry,
))
{
is_oog = true;
} else {
is_oog = false;
}
}
/// Not the greatest but it works so will refactor later
```
I also worked on fixing access list entries since we were getting extra accounts in the bal. Our present work included all address present in state in BAL. This resulted in a lot of empty entries. To fix I added a check for confirming an address is present both in access list and is touched.
```rust
let in_access_list = tx
.tx()
.access_list()
.map(|al| al.flattened().iter().any(|(addr, _)| addr == address))
.unwrap_or(false);
// If address is in access list, require it to be touched
// If not in access list, push unconditionally
let should_push = if in_access_list {
account.is_touched() && account.status != AccountStatus::default()
} else {
true
};
if is_coinbase && account.balance_change == (U256::ZERO, U256::ZERO) {
continue;
}
if should_push {
if let Some(bal) = self.block_access_list.as_mut() {
bal.push(crate::eth::utils::from_account_with_tx_index(
*address,
self.receipts.len() as u64,
account,
initial_balance,
is_oog,
));
}
```
Another test condition that I fixed is coinbase. The present testing condition donot include coinbase if pre and post balance is zero.This however is under discussion to be changed to be included as empty account change in condition where there are system calls and excluded if nothing is present.
Apart from that there was a problem of entry coming as 0x00 in code change. I inspected it a bit `Bytecode::default().bytecode` which was causing extra 0..which was taken over by Rimeeeeee. Apart from that I attended the Bal Breakout and office hours. We also ran kurtosis but didn't get much time to inspect the errors. Had some problem with travel booking, Mario and Josh helped a lot. Our test result from current eest looks pretty good. I found the invalid account entries for failing tests and reported the bug. I hope soon it will be fixed and our branch will be all green :)