Skip to content

Commit

Permalink
♻️ More tests, fix blobbasefee byte
Browse files Browse the repository at this point in the history
  • Loading branch information
Philogy committed Sep 19, 2024
1 parent be5f8f5 commit 876077a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ mod tests {

#[test]
fn test_value_to_ref_extra_bytes() {
assert_eq!(value_to_ref_extra_bytes(0, true), 0);
assert_eq!(value_to_ref_extra_bytes(0, false), 1);

assert_eq!(value_to_ref_extra_bytes(1, false), 1);
assert_eq!(value_to_ref_extra_bytes(2, false), 1);
assert_eq!(value_to_ref_extra_bytes(3, false), 1);
Expand All @@ -272,5 +274,18 @@ mod tests {
assert_eq!(value_to_ref_extra_bytes(7, false), 1);
assert_eq!(value_to_ref_extra_bytes(8, false), 1);
assert_eq!(value_to_ref_extra_bytes(256, false), 2);
assert_eq!(value_to_ref_extra_bytes(65535, false), 2);
assert_eq!(value_to_ref_extra_bytes(65536, false), 3);

assert_eq!(value_to_ref_extra_bytes(1, true), 1);
assert_eq!(value_to_ref_extra_bytes(2, true), 1);
assert_eq!(value_to_ref_extra_bytes(3, true), 1);
assert_eq!(value_to_ref_extra_bytes(4, true), 1);
assert_eq!(value_to_ref_extra_bytes(5, true), 1);
assert_eq!(value_to_ref_extra_bytes(6, true), 1);
assert_eq!(value_to_ref_extra_bytes(7, true), 1);
assert_eq!(value_to_ref_extra_bytes(8, true), 1);
assert_eq!(value_to_ref_extra_bytes(256, true), 2);
assert_eq!(value_to_ref_extra_bytes(65536, true), 3);
}
}
2 changes: 1 addition & 1 deletion src/opcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl Opcode {
Self::SELFBALANCE => 0x47,
Self::BASEFEE => 0x48,
Self::BLOBHASH => 0x49,
Self::BLOBBASEFEE => 0x50,
Self::BLOBBASEFEE => 0x4a,
// Control flow, Storage & Memory manipulation, runtime inspection 0x50 - 0x5e
Self::POP => 0x50,
Self::MLOAD => 0x51,
Expand Down

0 comments on commit 876077a

Please sign in to comment.