Skip to content

Commit 32b4008

Browse files
committed
test(interpreter): drop pop_address regression test per review
Remove `pop_address_truncates_to_low_20_bytes` as requested in review on #3735 — the truncation behaviour is covered by the shared `IntoAddress` conversion path and the dedicated test is not needed.
1 parent ada161c commit 32b4008

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

  • crates/interpreter/src/interpreter

crates/interpreter/src/interpreter/stack.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -502,34 +502,6 @@ mod tests {
502502
});
503503
}
504504

505-
#[test]
506-
fn pop_address_truncates_to_low_20_bytes() {
507-
use primitives::Address;
508-
509-
// A full 32-byte word whose high 12 bytes are set and must be discarded,
510-
// and whose low 20 bytes are the address. This mirrors how the EVM reads an
511-
// address from a stack word (e.g. BALANCE/EXTCODESIZE/EXTCODECOPY targets).
512-
let word = U256::from_be_bytes::<32>([
513-
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x11, 0x22,
514-
0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00,
515-
0x12, 0x34, 0x56, 0x78,
516-
]);
517-
let expected = Address::from([
518-
0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee,
519-
0xff, 0x00, 0x12, 0x34, 0x56, 0x78,
520-
]);
521-
522-
run(|stack| {
523-
assert!(stack.push(word));
524-
assert_eq!(stack.pop_address(), Some(expected));
525-
});
526-
527-
// Empty stack returns None rather than panicking.
528-
run(|stack| {
529-
assert_eq!(stack.pop_address(), None);
530-
});
531-
}
532-
533505
#[test]
534506
fn stack_clone() {
535507
// Test cloning an empty stack

0 commit comments

Comments
 (0)