Skip to content

Commit a42a6d5

Browse files
committed
Display first 6 signs of fork class hash
1 parent 313de2f commit a42a6d5

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

crates/forge-runner/src/gas/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use starknet_types_core::felt::Felt;
22

33
pub(super) fn shorten_felt(felt: Felt) -> String {
44
let padded = format!("{felt:#066x}");
5-
let first = &padded[..4];
5+
let first = &padded[..6];
66
let last = &padded[padded.len() - 4..];
77
format!("{first}…{last}")
88
}
@@ -16,12 +16,12 @@ mod tests {
1616
let felt = Felt::from_hex_unchecked(
1717
"0x01c902da594beda43db10142ecf1fc3a098b56e8d95f3cd28587a0c6ba05a451",
1818
);
19-
assert_eq!("0x01…a451", &shorten_felt(felt));
19+
assert_eq!("0x01c9…a451", &shorten_felt(felt));
2020
}
2121

2222
#[test]
2323
fn test_short() {
2424
let felt = Felt::from_hex_unchecked("0x123");
25-
assert_eq!("0x00…0123", &shorten_felt(felt));
25+
assert_eq!("0x0000…0123", &shorten_felt(felt));
2626
}
2727
}

crates/forge/tests/e2e/gas_report.rs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,27 +138,26 @@ fn fork() {
138138
Collected 1 test(s) from forking package
139139
Running 1 test(s) from src/
140140
[PASS] forking::tests::test_track_resources (l1_gas: ~0, l1_data_gas: ~[..], l2_gas: ~[..])
141-
╭-------------------------+-------+-------+-------+---------+---------╮
142-
| forked contract | | | | | |
143-
| (class hash: 0x06…1550) | | | | | |
144-
+=====================================================================+
145-
| Function Name | Min | Max | Avg | Std Dev | # Calls |
146-
|-------------------------+-------+-------+-------+---------+---------|
147-
| get_balance | 40000 | 40000 | 40000 | 0 | 1 |
148-
|-------------------------+-------+-------+-------+---------+---------|
149-
| increase_balance | 40000 | 40000 | 40000 | 0 | 1 |
150-
╰-------------------------+-------+-------+-------+---------+---------╯
151-
152-
╭-------------------------+-------+-------+-------+---------+---------╮
153-
| forked contract | | | | | |
154-
| (class hash: 0x07…af4b) | | | | | |
155-
+=====================================================================+
156-
| Function Name | Min | Max | Avg | Std Dev | # Calls |
157-
|-------------------------+-------+-------+-------+---------+---------|
158-
| get_balance | 13840 | 13840 | 13840 | 0 | 1 |
159-
|-------------------------+-------+-------+-------+---------+---------|
160-
| increase_balance | 25840 | 25840 | 25840 | 0 | 1 |
161-
╰-------------------------+-------+-------+-------+---------+---------╯
141+
╭---------------------------+-------+-------+-------+---------+---------╮
142+
| forked contract | | | | | |
143+
| (class hash: 0x06a7…1550) | | | | | |
144+
+=======================================================================+
145+
| Function Name | Min | Max | Avg | Std Dev | # Calls |
146+
|---------------------------+-------+-------+-------+---------+---------|
147+
| get_balance | 40000 | 40000 | 40000 | 0 | 1 |
148+
|---------------------------+-------+-------+-------+---------+---------|
149+
| increase_balance | 40000 | 40000 | 40000 | 0 | 1 |
150+
╰---------------------------+-------+-------+-------+---------+---------╯
151+
╭---------------------------+-------+-------+-------+---------+---------╮
152+
| forked contract | | | | | |
153+
| (class hash: 0x07aa…af4b) | | | | | |
154+
+=======================================================================+
155+
| Function Name | Min | Max | Avg | Std Dev | # Calls |
156+
|---------------------------+-------+-------+-------+---------+---------|
157+
| get_balance | 13840 | 13840 | 13840 | 0 | 1 |
158+
|---------------------------+-------+-------+-------+---------+---------|
159+
| increase_balance | 25840 | 25840 | 25840 | 0 | 1 |
160+
╰---------------------------+-------+-------+-------+---------+---------╯
162161
163162
Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out
164163
"},

0 commit comments

Comments
 (0)