Rename cursor functions (#787)

This commit is contained in:
LambdaClass
2023-01-10 16:08:30 -03:00
committed by GitHub
parent e5e74cbc02
commit 3bd1458df6
17 changed files with 90 additions and 90 deletions

View File

@@ -180,7 +180,7 @@ impl<'a, DB: Database> DbTool<'a, DB> {
fn list_table<T: Table>(&mut self, start: usize, len: usize) -> Result<()> {
let data = self.db.view(|tx| {
let mut cursor = tx.cursor::<T>().expect("Was not able to obtain a cursor.");
let mut cursor = tx.cursor_read::<T>().expect("Was not able to obtain a cursor.");
// TODO: Upstream this in the DB trait.
let start_walker = cursor.current().transpose();

View File

@@ -153,7 +153,7 @@ pub async fn run_test(path: PathBuf) -> eyre::Result<()> {
tx.commit()?;
let storage = db.view(|tx| -> Result<_, DbError> {
let mut cursor = tx.cursor_dup::<tables::PlainStorageState>()?;
let mut cursor = tx.cursor_dup_read::<tables::PlainStorageState>()?;
let walker = cursor.first()?.map(|first| cursor.walk(first.0)).transpose()?;
Ok(walker.map(|mut walker| {
let mut map: HashMap<Address, HashMap<U256, U256>> = HashMap::new();
@@ -192,7 +192,7 @@ pub async fn run_test(path: PathBuf) -> eyre::Result<()> {
info!("Post state is root: #{root:?}")
}
Some(RootOrState::State(state)) => db.view(|tx| -> eyre::Result<()> {
let mut cursor = tx.cursor_dup::<tables::PlainStorageState>()?;
let mut cursor = tx.cursor_dup_read::<tables::PlainStorageState>()?;
let walker = cursor.first()?.map(|first| cursor.walk(first.0)).transpose()?;
let storage = walker.map(|mut walker| {
let mut map: HashMap<Address, HashMap<U256, U256>> = HashMap::new();