Skip to content
Snippets Groups Projects
Commit 5b94413f authored by Cédric Moreau's avatar Cédric Moreau
Browse files

feat: add success or failure messages for `certify` and `adhere` commands

parent be112e11
No related branches found
No related tags found
No related merge requests found
......@@ -44,5 +44,11 @@ pub fn adhere(keyring: &Box<dyn ToDuniterKey>, node: &BmaNode) -> Result<(), Str
adhere_blockstamp: current_blockstamp.clone(),
};
let signature = keyring.sign(&membership);
crate::bma::wot::membership(&node, &membership.to_signable(), &signature.to_string())
let result = crate::bma::wot::membership(&node, &membership.to_signable(), &signature.to_string());
if let Ok(_) = result {
println!("Membership sent successfully.");
} else {
eprintln!("An error occured during adhesion.");
}
result
}
\ No newline at end of file
......@@ -43,5 +43,11 @@ pub fn certify(keyring: &Box<dyn ToDuniterKey>, node: &BmaNode, uid_or_pub: &Str
cert_blockstamp: current_blockstamp.clone(),
};
let signature = keyring.sign(&certification);
crate::bma::wot::certify(&node, &certification.to_signable(), &signature.to_string())
let result = crate::bma::wot::certify(&node, &certification.to_signable(), &signature.to_string());
if let Ok(_) = result {
println!("Certification sent successfully.");
} else {
eprintln!("An error occured during certification.");
}
result
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment