Skip to content

Commit

Permalink
use Infallible for memory db's error type (bluealloy#196)
Browse files Browse the repository at this point in the history
* use Infallible for memory db's error type

* std to core

* chore: rustfmt
  • Loading branch information
mattsse authored Sep 1, 2022
1 parent cef3e7a commit aeafa8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/revm/src/db/in_memory_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::{DatabaseCommit, DatabaseRef};
use crate::{interpreter::bytecode::Bytecode, Database, KECCAK_EMPTY};
use crate::{Account, AccountInfo, Log};
use alloc::vec::Vec;
use core::convert::Infallible;
use hashbrown::{hash_map::Entry, HashMap as Map};
use primitive_types::{H160, H256, U256};
use sha3::{Digest, Keccak256};
Expand Down Expand Up @@ -325,7 +326,7 @@ impl<ExtDB: DatabaseRef> DatabaseRef for CacheDB<ExtDB> {
pub struct EmptyDB();

impl DatabaseRef for EmptyDB {
type Error = ();
type Error = Infallible;
/// Get basic account information.
fn basic(&self, _address: H160) -> Result<Option<AccountInfo>, Self::Error> {
Ok(None)
Expand Down Expand Up @@ -361,7 +362,7 @@ impl BenchmarkDB {
}

impl Database for BenchmarkDB {
type Error = ();
type Error = Infallible;
/// Get basic account information.
fn basic(&mut self, address: H160) -> Result<Option<AccountInfo>, Self::Error> {
if address == H160::zero() {
Expand Down

0 comments on commit aeafa8d

Please sign in to comment.