Skip to content

Commit a602104

Browse files
committed
chore: use display on alloy nums
1 parent 3e18639 commit a602104

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

crates/evm/src/executor/backend/diagnostic.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::{
44
};
55
use alloy_primitives::Address;
66
use foundry_common::fmt::UIfmt;
7+
use itertools::Itertools;
78

89
/// Represents possible diagnostic cases on revert
910
#[derive(Debug, Clone)]
@@ -33,8 +34,11 @@ impl RevertDiagnostic {
3334
let contract_label = get_label(&b160_to_h160(*contract));
3435

3536
format!(
36-
r#"Contract {contract_label} does not exist on active fork with id `{active}`
37-
But exists on non active forks: `{available_on:?}`"#
37+
r#"Contract {} does not exist on active fork with id `{}`
38+
But exists on non active forks: `[{}]`"#,
39+
contract_label,
40+
active,
41+
available_on.iter().format(", ")
3842
)
3943
}
4044
RevertDiagnostic::ContractDoesNotExist { contract, persistent, .. } => {

crates/forge/tests/it/fork.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async fn test_cheats_fork_revert() {
2828
for (_, result) in test_results {
2929
assert_eq!(
3030
result.reason.unwrap(),
31-
"Contract 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f does not exist on active fork with id `1`\n But exists on non active forks: `[0x0_U256]`"
31+
"Contract 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f does not exist on active fork with id `1`\n But exists on non active forks: `[0]`"
3232
);
3333
}
3434
}

0 commit comments

Comments
 (0)