11// Copyright 2022 IOTA Stiftung
22// SPDX-License-Identifier: Apache-2.0
33
4+ /// A module that provides block related INX responses.
45pub mod responses;
56
67use futures:: stream:: { Stream , StreamExt } ;
@@ -15,7 +16,7 @@ use crate::{
1516} ;
1617
1718impl Inx {
18- // TODO
19+ /// Listens to all blocks.
1920 pub async fn listen_to_blocks ( & mut self ) -> Result < impl Stream < Item = Result < Block , Error > > , Error > {
2021 Ok ( self
2122 . client
@@ -25,7 +26,7 @@ impl Inx {
2526 . map ( try_from_inx_type) )
2627 }
2728
28- // TODO
29+ /// Listens to solid blocks.
2930 pub async fn listen_to_solid_blocks ( & mut self ) -> Result < impl Stream < Item = Result < BlockMetadata , Error > > , Error > {
3031 Ok ( self
3132 . client
@@ -35,7 +36,7 @@ impl Inx {
3536 . map ( try_from_inx_type) )
3637 }
3738
38- // TODO
39+ /// Listens to referenced blocks.
3940 pub async fn listen_to_referenced_blocks (
4041 & mut self ,
4142 ) -> Result < impl Stream < Item = Result < BlockMetadata , Error > > , Error > {
@@ -47,7 +48,7 @@ impl Inx {
4748 . map ( try_from_inx_type) )
4849 }
4950
50- // TODO
51+ /// Requests the block with the given block id.
5152 pub async fn read_block ( & mut self , block_id : bee:: BlockId ) -> Result < Raw < bee:: Block > , Error > {
5253 Ok ( self
5354 . client
@@ -58,7 +59,7 @@ impl Inx {
5859 . into ( ) )
5960 }
6061
61- // TODO
62+ /// Requests the metadata of the block with the given block id.
6263 pub async fn read_block_metadata ( & mut self , block_id : bee:: BlockId ) -> Result < BlockMetadata , Error > {
6364 Ok ( self
6465 . client
@@ -68,7 +69,7 @@ impl Inx {
6869 . try_into ( ) ?)
6970 }
7071
71- // TODO
72+ /// Submits a block and returns its corresponding block id.
7273 pub async fn submit_block ( & mut self , raw_block : Raw < bee:: Block > ) -> Result < bee:: BlockId , Error > {
7374 Ok ( self
7475 . client
0 commit comments