mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: move txtype constants to codecs (#12705)
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
15
crates/storage/codecs/src/txtype.rs
Normal file
15
crates/storage/codecs/src/txtype.rs
Normal 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;
|
||||
Reference in New Issue
Block a user