Skip to content

Commit

Permalink
chore: improve DatabaseError error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Feb 19, 2024
1 parent 95039bc commit 1a6c81e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/cheatcodes/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl Cheatcode for serializeBytes32_0Call {
impl Cheatcode for serializeString_0Call {
fn apply(&self, state: &mut Cheatcodes) -> Result {
let Self { objectKey, valueKey, value } = self;
serialize_json(state, objectKey, Some(valueKey), &value.to_string())
serialize_json(state, objectKey, Some(valueKey), value)
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/evm/core/src/backend/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ pub type DatabaseResult<T> = Result<T, DatabaseError>;
pub enum DatabaseError {
#[error("{0}")]
Message(String),
#[error("no cheats available for {0}")]
#[error("cheatcodes are not enabled for {0}; see `vm.allowCheatcodes(address)`")]
NoCheats(Address),
#[error("failed to fetch AccountInfo {0}")]
#[error("failed to fetch account info for {0}")]
MissingAccount(Address),
#[error("code should already be loaded: {0}")]
#[error("missing bytecode for hash: {0}")]
MissingCode(B256),
#[error(transparent)]
Recv(#[from] RecvError),
Expand Down

0 comments on commit 1a6c81e

Please sign in to comment.