anchor_provider -> tree_state_provider
This commit is contained in:
parent
0219337d1e
commit
fe45995dfa
|
@ -25,7 +25,7 @@ mod transaction_meta;
|
|||
mod transaction_provider;
|
||||
mod nullifier;
|
||||
mod tree_state;
|
||||
mod anchor;
|
||||
mod tree_state_provider;
|
||||
|
||||
pub use primitives::{hash, bytes};
|
||||
|
||||
|
@ -42,7 +42,7 @@ pub use transaction_meta::TransactionMeta;
|
|||
pub use transaction_provider::{TransactionProvider, TransactionOutputProvider, TransactionMetaProvider};
|
||||
pub use nullifier::{Nullifier, NullifierTracker};
|
||||
pub use tree_state::{TreeState, H32 as H32TreeDim, Dim as TreeDim, RegularTreeState};
|
||||
pub use anchor::AnchorProvider;
|
||||
pub use tree_state_provider::TreeStateProvider;
|
||||
|
||||
/// Epoch tag.
|
||||
///
|
||||
|
|
|
@ -2,7 +2,7 @@ use hash::H256;
|
|||
use bytes::Bytes;
|
||||
use {EpochTag, RegularTreeState};
|
||||
|
||||
pub trait AnchorProvider {
|
||||
pub trait TreeStateProvider {
|
||||
fn tree_bytes_at(&self, root: &H256) -> Option<Bytes>;
|
||||
|
||||
fn tree_at(&self, root: &H256) -> Option<RegularTreeState> {
|
||||
|
@ -13,4 +13,10 @@ pub trait AnchorProvider {
|
|||
.expect("Corrupted database: wrong tree state format!")
|
||||
)
|
||||
}
|
||||
|
||||
fn block_root(&self, block_hash: &H256) -> Option<H256>;
|
||||
|
||||
fn tree_at_block(&self, block_hash: &H256) -> Option<RegularTreeState> {
|
||||
self.block_root(block_hash).and_then(|h| self.tree_at(&h))
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue