@@ -26,6 +26,7 @@ use core::cell::UnsafeCell;
2626use bitcoin:: block:: Header as BlockHeader ;
2727use bitcoin:: blockdata:: constants:: genesis_block;
2828use bitcoin:: hashes:: sha256;
29+ use bitcoin:: hashes:: Hash ;
2930use bitcoin:: Block ;
3031use bitcoin:: BlockHash ;
3132use bitcoin:: Network ;
@@ -37,9 +38,9 @@ use bitcoin::Work;
3738use floresta_common:: Channel ;
3839#[ cfg( feature = "metrics" ) ]
3940use metrics;
40- use rustreexo:: accumulator :: node_hash:: BitcoinNodeHash ;
41- use rustreexo:: accumulator :: proof:: Proof ;
42- use rustreexo:: accumulator :: stump:: Stump ;
41+ use rustreexo:: node_hash:: BitcoinNodeHash ;
42+ use rustreexo:: proof:: Proof ;
43+ use rustreexo:: stump:: Stump ;
4344use spin:: RwLock ;
4445use tracing:: debug;
4546use tracing:: info;
@@ -576,7 +577,7 @@ impl<PersistedState: ChainStore> ChainState<PersistedState> {
576577 } ;
577578
578579 let mut acc = acc. as_slice ( ) ;
579- let acc = Stump :: deserialize ( & mut acc) . map_err ( BlockchainError :: UtreexoError ) ?;
580+ let acc = Stump :: deserialize ( & mut acc) ?;
580581 Ok ( Some ( acc) )
581582 }
582583
@@ -1000,7 +1001,10 @@ impl<PersistedState: ChainStore> BlockchainInterface for ChainState<PersistedSta
10001001 acc : Stump ,
10011002 ) -> Result < ( ) , Self :: Error > {
10021003 // Convert to BitcoinNodeHashes, from rustreexo
1003- let del_hashes: Vec < _ > = del_hashes. into_iter ( ) . map ( Into :: into) . collect ( ) ;
1004+ let del_hashes: Vec < _ > = del_hashes
1005+ . into_iter ( )
1006+ . map ( |hash| BitcoinNodeHash :: Some ( hash. to_byte_array ( ) ) )
1007+ . collect ( ) ;
10041008
10051009 if !acc. verify ( & proof, & del_hashes) ? {
10061010 return Err ( BlockValidationErrors :: InvalidProof ) ?;
@@ -1452,8 +1456,8 @@ mod test {
14521456 use floresta_common:: assert_ok;
14531457 use floresta_common:: bhash;
14541458 use rand:: Rng ;
1455- use rustreexo:: accumulator :: proof:: Proof ;
1456- use rustreexo:: accumulator :: stump:: Stump ;
1459+ use rustreexo:: proof:: Proof ;
1460+ use rustreexo:: stump:: Stump ;
14571461
14581462 use super :: BlockchainInterface ;
14591463 use super :: ChainParams ;
0 commit comments