From 9280fabee2a8e1cf6661d30f685cc6ba21d8a725 Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Mon, 28 Aug 2023 15:48:08 +0000 Subject: [PATCH] Add node type to api + proofs Proofs need to how to fetch data from a node they are operating on. --- firewood/src/v2/api.rs | 10 +++++----- firewood/src/v2/db.rs | 4 ++-- firewood/src/v2/emptydb.rs | 4 ++-- firewood/src/v2/propose.rs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/firewood/src/v2/api.rs b/firewood/src/v2/api.rs index 4e119eb17..08e8b6c9c 100644 --- a/firewood/src/v2/api.rs +++ b/firewood/src/v2/api.rs @@ -69,9 +69,9 @@ pub enum Error { /// A range proof, consisting of a proof of the first key and the last key, /// and a vector of all key/value pairs #[derive(Debug)] -pub struct RangeProof { - pub first_key: Proof, - pub last_key: Proof, +pub struct RangeProof + Send> { + pub first_key: Proof, + pub last_key: Proof, pub middle: Vec<(K, V)>, } @@ -147,12 +147,12 @@ pub trait DbView { /// * `last_key` - If None, continue to the end of the database /// * `limit` - The maximum number of keys in the range proof /// - async fn range_proof( + async fn range_proof + Send>( &self, first_key: Option, last_key: Option, limit: usize, - ) -> Result>, Error>; + ) -> Result>, Error>; } /// A proposal for a new revision of the database. diff --git a/firewood/src/v2/db.rs b/firewood/src/v2/db.rs index 5df02441e..6e22d4c86 100644 --- a/firewood/src/v2/db.rs +++ b/firewood/src/v2/db.rs @@ -83,12 +83,12 @@ impl api::DbView for DbView { todo!() } - async fn range_proof( + async fn range_proof + Send>( &self, _first_key: Option, _last_key: Option, _limit: usize, - ) -> Result>, api::Error> { + ) -> Result>, api::Error> { todo!() } } diff --git a/firewood/src/v2/emptydb.rs b/firewood/src/v2/emptydb.rs index 31cd93212..86b37d4c7 100644 --- a/firewood/src/v2/emptydb.rs +++ b/firewood/src/v2/emptydb.rs @@ -65,12 +65,12 @@ impl DbView for HistoricalImpl { Ok(None) } - async fn range_proof( + async fn range_proof + Send>( &self, _first_key: Option, _last_key: Option, _limit: usize, - ) -> Result>, Error> { + ) -> Result>, Error> { Ok(None) } } diff --git a/firewood/src/v2/propose.rs b/firewood/src/v2/propose.rs index 5b8d3422d..14a9065d3 100644 --- a/firewood/src/v2/propose.rs +++ b/firewood/src/v2/propose.rs @@ -125,12 +125,12 @@ impl api::DbView for Proposal { todo!() } - async fn range_proof( + async fn range_proof + Send>( &self, _first_key: Option, _last_key: Option, _limit: usize, - ) -> Result>, api::Error> { + ) -> Result>, api::Error> { todo!() } }