mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 14:53:08 +00:00
Feedback
This commit is contained in:
parent
ff228c9386
commit
6b3853592b
@ -1,17 +1,25 @@
|
||||
use ethereum_types::U256;
|
||||
|
||||
/// A partial trie, or a sub-trie thereof.
|
||||
/// A partial trie, or a sub-trie thereof. This mimics the structure of an Ethereum trie, except
|
||||
/// with an additional `Hash` node type, representing a node whose data is not needed to process
|
||||
/// our transaction.
|
||||
pub enum PartialTrie {
|
||||
/// An empty trie.
|
||||
Empty,
|
||||
/// The digest of trie whose data does not need to be stored.
|
||||
Hash(U256),
|
||||
/// A branch node, which consists of 16 children and an optional value.
|
||||
Branch([Box<PartialTrie>; 16], Option<U256>),
|
||||
Branch {
|
||||
children: [Box<PartialTrie>; 16],
|
||||
value: Option<U256>,
|
||||
},
|
||||
/// An extension node, which consists of a list of nibbles and a single child.
|
||||
Extension(Nibbles, Box<PartialTrie>),
|
||||
Extension {
|
||||
nibbles: Nibbles,
|
||||
child: Box<PartialTrie>,
|
||||
},
|
||||
/// A leaf node, which consists of a list of nibbles and a value.
|
||||
Leaf(Nibbles, Vec<u8>),
|
||||
Leaf { nibbles: Nibbles, value: Vec<u8> },
|
||||
}
|
||||
|
||||
/// A sequence of nibbles.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user