mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: impl From alloy-consensus::TxType for reth_primitives::TxType (#10523)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8126,6 +8126,7 @@ dependencies = [
|
|||||||
name = "reth-primitives"
|
name = "reth-primitives"
|
||||||
version = "1.0.5"
|
version = "1.0.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"alloy-consensus",
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
"alloy-genesis",
|
"alloy-genesis",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
|
|||||||
@ -27,6 +27,7 @@ alloy-rlp = { workspace = true, features = ["arrayvec"] }
|
|||||||
alloy-rpc-types = { workspace = true, optional = true }
|
alloy-rpc-types = { workspace = true, optional = true }
|
||||||
alloy-genesis.workspace = true
|
alloy-genesis.workspace = true
|
||||||
alloy-eips = { workspace = true, features = ["serde"] }
|
alloy-eips = { workspace = true, features = ["serde"] }
|
||||||
|
alloy-consensus.workspace = true
|
||||||
|
|
||||||
# crypto
|
# crypto
|
||||||
secp256k1 = { workspace = true, features = [
|
secp256k1 = { workspace = true, features = [
|
||||||
|
|||||||
@ -220,6 +220,18 @@ impl Decodable for TxType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<alloy_consensus::TxType> for TxType {
|
||||||
|
fn from(value: alloy_consensus::TxType) -> Self {
|
||||||
|
match value {
|
||||||
|
alloy_consensus::TxType::Legacy => Self::Legacy,
|
||||||
|
alloy_consensus::TxType::Eip2930 => Self::Eip2930,
|
||||||
|
alloy_consensus::TxType::Eip1559 => Self::Eip1559,
|
||||||
|
alloy_consensus::TxType::Eip4844 => Self::Eip4844,
|
||||||
|
//alloy_consensus::TxType::Eip7702 => Self::Eip7702,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::hex;
|
use crate::hex;
|
||||||
|
|||||||
Reference in New Issue
Block a user