Skip to content

Commit

Permalink
api/v2: Update hash fn to root_hash (#170)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Sover <[email protected]>
  • Loading branch information
exdx authored and rkuris committed Aug 1, 2023
1 parent 7e6bea0 commit f08367a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions firewood/src/v2/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ pub trait Db {
/// A [Proposal] requires implementing DbView
#[async_trait]
pub trait DbView {
/// Get the hash for the current DbView
async fn hash(&self) -> Result<HashKey, Error>;
/// Get the root hash for the current DbView
async fn root_hash(&self) -> Result<HashKey, Error>;

/// Get the value of a specific key
async fn val<K: KeyType>(&self, key: K) -> Result<Vec<u8>, Error>;
Expand Down
2 changes: 1 addition & 1 deletion firewood/src/v2/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct DbView;

#[async_trait]
impl api::DbView for DbView {
async fn hash(&self) -> Result<api::HashKey, api::Error> {
async fn root_hash(&self) -> Result<api::HashKey, api::Error> {
todo!()
}

Expand Down
2 changes: 1 addition & 1 deletion firewood/src/v2/emptydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Db for EmptyDb {

#[async_trait]
impl DbView for HistoricalImpl {
async fn hash(&self) -> Result<HashKey, Error> {
async fn root_hash(&self) -> Result<HashKey, Error> {
Ok(ROOT_HASH)
}

Expand Down
2 changes: 1 addition & 1 deletion firewood/src/v2/propose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl<T> Proposal<T> {

#[async_trait]
impl<T: api::DbView + Send + Sync> api::DbView for Proposal<T> {
async fn hash(&self) -> Result<api::HashKey, api::Error> {
async fn root_hash(&self) -> Result<api::HashKey, api::Error> {
todo!()
}

Expand Down

0 comments on commit f08367a

Please sign in to comment.