Skip to content

Commit

Permalink
add bitflag_encoded_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Sep 2, 2024
1 parent 8e9d2cc commit 9b5d7f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/storage/codecs/src/alloy/transaction/eip7702.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use alloc::vec::Vec;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize, Compact)]
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
#[add_arbitrary_tests(compact)]
struct TxEip7702 {
pub(crate) struct TxEip7702 {
chain_id: ChainId,
nonce: u64,
gas_limit: u64,
Expand Down
6 changes: 5 additions & 1 deletion crates/storage/codecs/src/alloy/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ mod tests {
// this check is to ensure we do not inadvertently add too many fields to a struct which would
// expand the flags field and break backwards compatibility

use super::{eip1559::TxEip1559, eip2930::TxEip2930, eip4844::TxEip4844, legacy::TxLegacy};
use super::{
eip1559::TxEip1559, eip2930::TxEip2930, eip4844::TxEip4844, eip7702::TxEip7702,
legacy::TxLegacy,
};

#[test]
fn test_ensure_backwards_compatibility() {
assert_eq!(TxEip4844::bitflag_encoded_bytes(), 5);
assert_eq!(TxLegacy::bitflag_encoded_bytes(), 3);
assert_eq!(TxEip1559::bitflag_encoded_bytes(), 4);
assert_eq!(TxEip2930::bitflag_encoded_bytes(), 3);
assert_eq!(TxEip7702::bitflag_encoded_bytes(), 4);
}
}

0 comments on commit 9b5d7f3

Please sign in to comment.