mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(exex): derive serde ser/deser for ExExNotification (#8963)
This commit is contained in:
@ -40,6 +40,9 @@ metrics = { workspace = true, optional = true }
|
||||
# `test-utils` feature
|
||||
triehash = { version = "0.8", optional = true }
|
||||
|
||||
# `serde` feature
|
||||
serde = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# reth
|
||||
reth-chainspec.workspace = true
|
||||
@ -67,6 +70,7 @@ criterion.workspace = true
|
||||
|
||||
[features]
|
||||
metrics = ["reth-metrics", "dep:metrics"]
|
||||
serde = ["dep:serde"]
|
||||
test-utils = ["triehash", "reth-trie-common/test-utils"]
|
||||
|
||||
[[bench]]
|
||||
|
||||
@ -13,6 +13,7 @@ use std::collections::{hash_map::IntoIter, HashMap, HashSet};
|
||||
|
||||
/// The key of a trie node.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum TrieKey {
|
||||
/// A node in the account trie.
|
||||
AccountNode(StoredNibbles),
|
||||
@ -24,6 +25,7 @@ pub enum TrieKey {
|
||||
|
||||
/// The operation to perform on the trie.
|
||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum TrieOp {
|
||||
/// Delete the node entry.
|
||||
Delete,
|
||||
@ -40,6 +42,7 @@ impl TrieOp {
|
||||
|
||||
/// The aggregation of trie updates.
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Deref)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct TrieUpdates {
|
||||
trie_operations: HashMap<TrieKey, TrieOp>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user