chore: move txtype constants to codecs (#12705)

This commit is contained in:
Matthias Seitz
2024-11-20 13:18:58 +01:00
committed by GitHub
parent f12d7a9264
commit 402f96600b
6 changed files with 61 additions and 74 deletions

View File

@ -17,13 +17,14 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
pub use reth_codecs_derive::*;
use serde as _;
use alloy_primitives::{Address, Bloom, Bytes, FixedBytes, U256};
use bytes::{Buf, BufMut};
extern crate alloc;
use alloc::vec::Vec;
#[cfg(feature = "test-utils")]
@ -33,6 +34,8 @@ pub mod alloy;
#[cfg(any(test, feature = "alloy"))]
mod alloy;
pub mod txtype;
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;

View File

@ -0,0 +1,15 @@
//! Commonly used constants for transaction types.
/// Identifier parameter for legacy transaction
pub const COMPACT_IDENTIFIER_LEGACY: usize = 0;
/// Identifier parameter for EIP-2930 transaction
pub const COMPACT_IDENTIFIER_EIP2930: usize = 1;
/// Identifier parameter for EIP-1559 transaction
pub const COMPACT_IDENTIFIER_EIP1559: usize = 2;
/// For backwards compatibility purposes only 2 bits of the type are encoded in the identifier
/// parameter. In the case of a [`COMPACT_EXTENDED_IDENTIFIER_FLAG`], the full transaction type is
/// read from the buffer as a single byte.
pub const COMPACT_EXTENDED_IDENTIFIER_FLAG: usize = 3;