@@ -11,6 +11,7 @@ use crate::libp2p_bitswap::{BitswapStoreRead, BitswapStoreReadWrite};
1111use crate :: rpc:: eth:: types:: EthHash ;
1212use crate :: utils:: { broadcast:: has_subscribers, multihash:: prelude:: * } ;
1313use anyhow:: Context as _;
14+ use bytes:: Bytes ;
1415use cid:: Cid ;
1516use fvm_ipld_blockstore:: Blockstore ;
1617use fvm_ipld_encoding:: DAG_CBOR ;
@@ -83,7 +84,7 @@ impl DbColumn {
8384 }
8485}
8586
86- type WriteOpsBroadcastTxSender = tokio:: sync:: broadcast:: Sender < Vec < ( Cid , bytes :: Bytes ) > > ;
87+ type WriteOpsBroadcastTxSender = tokio:: sync:: broadcast:: Sender < Vec < ( Cid , Bytes ) > > ;
8788
8889pub struct ParityDb {
8990 pub db : parity_db:: Db ,
@@ -242,7 +243,7 @@ impl Blockstore for ParityDb {
242243 self . write_to_column ( k. to_bytes ( ) , block, column) ?;
243244 match & * self . write_ops_broadcast_tx . read ( ) {
244245 Some ( tx) if has_subscribers ( tx) => {
245- let _ = tx. send ( vec ! [ ( * k, bytes :: Bytes :: copy_from_slice( block) ) ] ) ;
246+ let _ = tx. send ( vec ! [ ( * k, Bytes :: copy_from_slice( block) ) ] ) ;
246247 }
247248 _ => { }
248249 }
@@ -263,7 +264,7 @@ impl Blockstore for ParityDb {
263264 let column = Self :: choose_column ( & k) ;
264265 let v = v. as_ref ( ) . to_vec ( ) ;
265266 if has_subscribers {
266- values_for_subscriber. push ( ( k, bytes :: Bytes :: copy_from_slice ( & v) ) ) ;
267+ values_for_subscriber. push ( ( k, Bytes :: copy_from_slice ( & v) ) ) ;
267268 }
268269 ( column, k. to_bytes ( ) , v)
269270 } ) ;
@@ -372,7 +373,7 @@ impl ParityDb {
372373}
373374
374375impl super :: BlockstoreWriteOpsSubscribable for ParityDb {
375- fn subscribe_write_ops ( & self ) -> tokio:: sync:: broadcast:: Receiver < Vec < ( Cid , bytes :: Bytes ) > > {
376+ fn subscribe_write_ops ( & self ) -> tokio:: sync:: broadcast:: Receiver < Vec < ( Cid , Bytes ) > > {
376377 let tx_lock = self . write_ops_broadcast_tx . read ( ) ;
377378 if let Some ( tx) = & * tx_lock {
378379 return tx. subscribe ( ) ;
@@ -557,7 +558,7 @@ mod test {
557558 for ( idx, cid) in cids. iter ( ) . enumerate ( ) {
558559 let data_entry = & data[ idx] ;
559560 db. put_keyed ( cid, data_entry) . unwrap ( ) ;
560- let expected = vec ! [ ( * cid, bytes :: Bytes :: copy_from_slice( data_entry) ) ] ;
561+ let expected = vec ! [ ( * cid, Bytes :: copy_from_slice( data_entry) ) ] ;
561562 assert_eq ! ( rx1. blocking_recv( ) . unwrap( ) , expected) ;
562563 assert_eq ! ( rx2. blocking_recv( ) . unwrap( ) , expected) ;
563564 }
0 commit comments