Skip to content

Commit 24bd227

Browse files
committed
chore: improve DatabaseError error messages
1 parent 95039bc commit 24bd227

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/cheatcodes/src/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl Cheatcode for serializeBytes32_0Call {
192192
impl Cheatcode for serializeString_0Call {
193193
fn apply(&self, state: &mut Cheatcodes) -> Result {
194194
let Self { objectKey, valueKey, value } = self;
195-
serialize_json(state, objectKey, Some(valueKey), &value.to_string())
195+
serialize_json(state, objectKey, Some(valueKey), value)
196196
}
197197
}
198198

crates/evm/core/src/backend/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ pub type DatabaseResult<T> = Result<T, DatabaseError>;
1515
pub enum DatabaseError {
1616
#[error("{0}")]
1717
Message(String),
18-
#[error("no cheats available for {0}")]
18+
#[error("cheatcodes are not enabled for {0}; see `vm.allowCheatcodes(address)`")]
1919
NoCheats(Address),
20-
#[error("failed to fetch AccountInfo {0}")]
20+
#[error("failed to fetch account info for {0}")]
2121
MissingAccount(Address),
22-
#[error("code should already be loaded: {0}")]
22+
#[error("missing bytecode for code hash {0}")]
2323
MissingCode(B256),
2424
#[error(transparent)]
2525
Recv(#[from] RecvError),

0 commit comments

Comments
 (0)