@@ -13,6 +13,7 @@ use crate::{
1313 self ,
1414 any:: {
1515 db:: Db ,
16+ operation:: { update:: Update , Operation } ,
1617 ordered:: {
1718 fixed:: {
1819 Db as OrderedFixedDb , Operation as OrderedFixedOp , Update as OrderedFixedUpdate ,
@@ -34,12 +35,12 @@ use crate::{
3435 } ,
3536 FixedConfig , FixedValue , VariableConfig , VariableValue ,
3637 } ,
37- operation:: { Committable , Key , Operation } ,
38+ operation:: { Committable , Key } ,
3839 } ,
3940 translator:: Translator ,
40- Context ,
41+ Context , Persistable ,
4142} ;
42- use commonware_codec:: { CodecShared , Read as CodecRead } ;
43+ use commonware_codec:: { Codec , CodecShared , Read as CodecRead } ;
4344use commonware_cryptography:: Hasher ;
4445use commonware_utils:: { range:: NonEmptyRange , Array } ;
4546
8182}
8283
8384/// Shared helper to build a [Db] from sync components.
84- async fn build_db < F , E , O , I , H , U , C , T > (
85+ async fn build_db < F , E , U , I , H , C , T > (
8586 context : E ,
8687 merkle_config : journaled:: Config ,
8788 log : C ,
@@ -93,12 +94,12 @@ async fn build_db<F, E, O, I, H, U, C, T>(
9394where
9495 F : merkle:: Family ,
9596 E : Context ,
96- O : Operation < F > + Committable + CodecShared + Send + Sync + ' static ,
97+ U : Update + Send + Sync + ' static ,
9798 I : IndexFactory < T , Value = Location < F > > ,
9899 H : Hasher ,
99- U : Send + Sync + ' static ,
100100 T : Translator ,
101- C : Mutable < Item = O > ,
101+ C : Mutable < Item = Operation < F , U > > + Persistable < Error = crate :: journal:: Error > ,
102+ Operation < F , U > : Codec + Committable + CodecShared ,
102103{
103104 let hasher = StandardHasher :: < H > :: new ( ) ;
104105
@@ -122,7 +123,7 @@ where
122123 apply_batch_size as u64 ,
123124 )
124125 . await ?;
125- let db = Db :: from_components ( range. start ( ) , log , index ) . await ?;
126+ let db = Db :: init_from_log ( index , log , Some ( range. start ( ) ) , |_ , _| { } ) . await ?;
126127
127128 Ok ( db)
128129}
@@ -160,7 +161,7 @@ macro_rules! impl_sync_database {
160161 ) -> Result <Self , qmdb:: Error <F >> {
161162 let merkle_config = config. merkle_config. clone( ) ;
162163 let translator = config. translator. clone( ) ;
163- build_db:: <F , _, Self :: Op , _ , H , $update<K , V >, _, T >(
164+ build_db:: <F , _, $update<K , V >, _ , H , _, T >(
164165 context,
165166 merkle_config,
166167 log,
0 commit comments