verbs_rs/db/
traits.rs

1use super::error::DatabaseError;
2use alloy_primitives::Address;
3use revm::{
4    db::{Database, DbAccount},
5    primitives::{AccountInfo, Bytecode, HashMap, Log, B256, U256},
6    DatabaseCommit,
7};
8
9/// Combined `Revm` database trait with data export methods
10///
11/// Extends the [Database] and [DatabaseCommit] traits with
12/// methods to export the state of the DB. These methods
13/// allow the Db state to be exported from the Python API.
14pub trait DB: Database<Error = DatabaseError> + DatabaseCommit {
15    fn insert_account_info(&mut self, address: Address, account_info: AccountInfo);
16    fn accounts(&self) -> &HashMap<Address, DbAccount>;
17    fn contracts(&self) -> &HashMap<B256, Bytecode>;
18    fn logs(&self) -> &Vec<Log>;
19    fn block_hashes(&self) -> &HashMap<U256, B256>;
20}