Skip to content

Commit

Permalink
feat: working upload and download
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Oct 1, 2024
1 parent e3d72fd commit 05da821
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions autonomi_cli/src/commands/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

use autonomi::client::address::{str_to_xorname, xorname_to_str};
use autonomi::client::address::xorname_to_str;
use autonomi::Wallet;
use autonomi::Multiaddr;
use color_eyre::eyre::{eyre, Context};
use color_eyre::eyre::Context;
use color_eyre::eyre::Result;
use std::path::PathBuf;

Expand Down Expand Up @@ -50,7 +50,7 @@ pub async fn download(addr: &str, dest_path: &str, peers: Vec<Multiaddr>) -> Res
crate::actions::download(addr, dest_path, &mut client).await
}

pub fn list(peers: Vec<Multiaddr>) -> Result<()> {
pub fn list(_peers: Vec<Multiaddr>) -> Result<()> {
println!("Listing previous uploads...");
Ok(())
}
10 changes: 5 additions & 5 deletions autonomi_cli/src/commands/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use autonomi::Multiaddr;
use color_eyre::eyre::Context;
use color_eyre::eyre::Result;

pub async fn cost(name: &str, peers: Vec<Multiaddr>) -> Result<()> {
pub async fn cost(name: &str, _peers: Vec<Multiaddr>) -> Result<()> {
let register_key = crate::utils::get_register_signing_key()
.wrap_err("The register key is required to perform this action")?;
println!("Estimate cost to register name: {name} with register key: {register_key}");
Ok(())
}

pub async fn create(name: &str, value: &str, peers: Vec<Multiaddr>) -> Result<()> {
pub async fn create(name: &str, value: &str, _peers: Vec<Multiaddr>) -> Result<()> {
let secret_key = crate::utils::get_secret_key()
.wrap_err("The secret key is required to perform this action")?;
let register_key = crate::utils::get_register_signing_key()
Expand All @@ -28,21 +28,21 @@ pub async fn create(name: &str, value: &str, peers: Vec<Multiaddr>) -> Result<()
Ok(())
}

pub async fn edit(name: &str, value: &str, peers: Vec<Multiaddr>) -> Result<()> {
pub async fn edit(name: &str, value: &str, _peers: Vec<Multiaddr>) -> Result<()> {
let register_key = crate::utils::get_register_signing_key()
.wrap_err("The register key is required to perform this action")?;
println!("Editing register: {name} with value: {value} using register key: {register_key}");
Ok(())
}

pub async fn get(name: &str, peers: Vec<Multiaddr>) -> Result<()> {
pub async fn get(name: &str, _peers: Vec<Multiaddr>) -> Result<()> {
let register_key = crate::utils::get_register_signing_key()
.wrap_err("The register key is required to perform this action")?;
println!("Getting value of register: {name} with register key: {register_key}");
Ok(())
}

pub fn list(peers: Vec<Multiaddr>) -> Result<()> {
pub fn list(_peers: Vec<Multiaddr>) -> Result<()> {
println!("Listing previous registers...");
Ok(())
}

0 comments on commit 05da821

Please sign in to comment.