summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-11-27 12:38:31 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-11-27 12:38:31 +0100
commita2770c67fa450598d8420b3a4b5243969ecdd251 (patch)
treee23878d88762050fde9b8a0e546e433b281b4fb4 /src
parent26e01c06f68ec4c44d8c14b6f2b470dc557d1c6c (diff)
Rename: Block -> Node
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r--src/client.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client.rs b/src/client.rs
index a000407..f984dfa 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -42,7 +42,7 @@ impl Client {
.and_then(crate::ipfs_client::backend::response::AddResponse::try_to_cid)
}
- /// Post a text block
+ /// Post a text node
///
/// Pass in the parents if there are any.
///
@@ -52,13 +52,13 @@ impl Client {
///
/// # Returns
///
- /// Returns the Cid of the newly created block, or an error
- pub async fn post_text_block(&self, parents: Vec<Cid>, text: String) -> Result<Cid> {
- self.post_text_block_with_datetime(parents, text, now()).await
+ /// Returns the Cid of the newly created node, or an error
+ pub async fn post_text_node(&self, parents: Vec<Cid>, text: String) -> Result<Cid> {
+ self.post_text_node_with_datetime(parents, text, now()).await
}
// For testing
- async fn post_text_block_with_datetime(&self, parents: Vec<Cid>, text: String, datetime: DateTime) -> Result<Cid> {
+ async fn post_text_node_with_datetime(&self, parents: Vec<Cid>, text: String, datetime: DateTime) -> Result<Cid> {
let text_blob_cid = self.post_text_blob(text).await?;
let payload = Payload::new(mime::TEXT_PLAIN_UTF_8.as_ref().to_string(), datetime, text_blob_cid);
@@ -111,7 +111,7 @@ mod tests {
}
#[tokio::test]
- async fn test_post_text_block() {
+ async fn test_post_text_node() {
use chrono::TimeZone;
let _ = env_logger::try_init();
@@ -123,7 +123,7 @@ mod tests {
.and_hms(12, 30, 0)
.into();
- let cid = client.post_text_block_with_datetime(Vec::new(), String::from("text"), datetime).await;
+ let cid = client.post_text_node_with_datetime(Vec::new(), String::from("text"), datetime).await;
assert!(cid.is_ok());
assert_eq!(cid.unwrap().as_ref(), "bafyreifqa7jqsazxvl53jb6sflzbk4nkv4j7b5jos6hlzh4fq55bjbvk3m");
}