New Functions added for getting additional details of transaction.
Type of change:
[1] Add a new method is_invalid to check if the transaction is invalid
[ 2] Add a new method sender_account to get the sender's account from the state database
[3 ]Add a new method get_call_by_index to get the call by index
[4 ]Add a new method value to get the transaction value
[5] Add a new method access_list_gas_cost to get the access list gas cost
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:
These changes are backward-compatible and do not introduce any dependencies on other parts of the codebase.
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:
above functions works is to find the account is sender's or not? if not then it will revert transaction.
Context:
The new functions provide additional details about transactions and enhance the capability to check for transaction validity, retrieve sender's account, etc.
changed file: main/bus-mapping/src/circuit_input_builder/transaction.rs
New Functions added for getting additional details of transaction.
Type of change:
is_invalid
to check if the transaction is invalidsender_account
to get the sender's account from the state databaseget_call_by_index
to get the call by indexvalue
to get the transaction valueaccess_list_gas_cost
to get the access list gas costDependencies/Impacts:
sender_account
function example of how it looks:Working:
Context: