taikoxyz / zkevm-circuits

DEPRECATED in favor of https://github.com/taikoxyz/raiko! Taiko's fork of the PSE's ZK-EVM
Other
159 stars 125 forks source link

add functions in the Transaction file #178

Closed cryptoryda closed 8 months ago

cryptoryda commented 9 months ago

changed file: main/bus-mapping/src/circuit_input_builder/transaction.rs

New Functions added for getting additional details of transaction.

Type of change:

This PR contains:
- Added `is_invalid`  `sender_account` `get_call_by_index` `value`  function to main/bus-mapping/src/circuit_input_builder/transaction.rs 

Dependencies/Impacts:

sender_account function example of how it looks:


 // Add a new method to get the sender's account from the state database
    pub fn sender_account(&self, sdb: &StateDB) -> Result<Account, Error> {
        let (found, account) = sdb.get_account(&self.tx.from);
        if !found {
            return Err(Error::AccountNotFound(self.tx.from));
        }
        Ok(account)
    }

Working:

Context:

cryptoryda commented 9 months ago

P.S if you would like to consider each change individually I can redo and submit each PR separately