Skip to content

Commit 1f1512a

Browse files
implement Resolver for poofs
1 parent f98eb0c commit 1f1512a

2 files changed

Lines changed: 4 additions & 24 deletions

File tree

examples/sync/src/net/resolver.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ where
232232
Op::Cfg: IsUnit,
233233
D: Digest,
234234
{
235-
type Family = mmr::Family;
236-
type Digest = D;
237-
type Error = crate::Error;
238-
239235
async fn current_target(
240236
&self,
241237
) -> Result<CurrentTarget<Self::Family, Self::Digest>, Self::Error> {

storage/src/qmdb/current/sync/mod.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,10 @@ pub(crate) mod tests;
161161
/// describe the same database state. Callers that learn trusted canonical roots from another source
162162
/// can cache these targets and use [`TargetMatcher`] to find a target whose root has been trusted
163163
/// before passing it to [`sync`].
164-
pub trait CurrentResolver: Send + Sync + Clone + 'static {
165-
/// Merkle family used by the database.
166-
type Family: Graftable;
167-
/// Root digest type.
168-
type Digest: Digest;
169-
/// Error type returned by the resolver.
170-
type Error: std::error::Error + Send + 'static;
171-
164+
pub trait CurrentResolver: qmdb_sync::Resolver
165+
where
166+
Self::Family: Graftable,
167+
{
172168
/// Fetch the latest full authenticated [`Target`].
173169
#[allow(clippy::type_complexity)]
174170
fn current_target(
@@ -1013,10 +1009,6 @@ macro_rules! impl_current_current_resolver {
10131009
S: Strategy,
10141010
$($($where_extra)+)?
10151011
{
1016-
type Family = F;
1017-
type Digest = H::Digest;
1018-
type Error = qmdb::Error<F>;
1019-
10201012
async fn current_target(&self) -> Result<Target<F, H::Digest>, Self::Error> {
10211013
let hasher = qmdb::hasher::<H>();
10221014
let witness = self.ops_root_witness(&hasher).await?;
@@ -1048,10 +1040,6 @@ macro_rules! impl_current_current_resolver {
10481040
S: Strategy,
10491041
$($($where_extra)+)?
10501042
{
1051-
type Family = F;
1052-
type Digest = H::Digest;
1053-
type Error = qmdb::Error<F>;
1054-
10551043
async fn current_target(&self) -> Result<Target<F, H::Digest>, Self::Error> {
10561044
let db = self.read().await;
10571045
let hasher = qmdb::hasher::<H>();
@@ -1084,10 +1072,6 @@ macro_rules! impl_current_current_resolver {
10841072
S: Strategy,
10851073
$($($where_extra)+)?
10861074
{
1087-
type Family = F;
1088-
type Digest = H::Digest;
1089-
type Error = qmdb::Error<F>;
1090-
10911075
async fn current_target(&self) -> Result<Target<F, H::Digest>, Self::Error> {
10921076
let guard = self.read().await;
10931077
let db = guard.as_ref()

0 commit comments

Comments
 (0)