deltadevsde / deltadevsde/prism
refactor: SnarkableTree
- Dominant language
- Rust
- Stars
- 134
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
```rust
/// Represents a tree that can be used to verifiably store and retrieve [`Account`]s.
/// The methods of this trait are NOT run in circuit: they are used to create verifiable inputs for the circuit.
/// This distinction is critical because the returned proofs must contain all information necessary to verify the operations.
pub trait SnarkableTree: Send + Sync {
fn process_transaction(&mut self, transaction: Transaction) -> Result;
fn insert(&mut self, key: KeyHash, tx: Transaction) -> Result;
fn update(&mut self, key: KeyHash, tx: Transaction) -> Result;
fn get(&self, key: KeyHash) -> Result;
}
```
This trait has changed a bit historically and is now big stupid. We should find a better way to model this. Specifically, it doesn't need to be a trait and KDT can implement the methods directly - with process_transaction and get being the only public methods
Contributor guide
Assessment
This issue has not been assessed yet.