summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-04-30 10:50:10 +0200
committerMatthias Beyer <mail@beyermatthias.de>2020-04-30 10:50:10 +0200
commit49a52af5e0b1f0ebd0e9a106557e7e1464dc9691 (patch)
tree6493dadd85f89153ebffdd48b46afadd75eeb46e
parentfd47924ec25359c0e383874cc4cbddaa1d155c29 (diff)
Add helper to get blocks of IPNS hash
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/app.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app.rs b/src/app.rs
index c0ef28e..d06e1d2 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -98,5 +98,9 @@ impl App {
})
}
+ pub async fn blocks_of(&self, ipns: IPNSHash) -> Result<impl Stream<Item = Result<Block, Error>>, Error> {
+ self.repo.resolve(ipns).await.map(|ipfs| self.blocks(ipfs))
+ }
+
}