Skip to content
Snippets Groups Projects

add renew cert and change arg to name

Merged Hugo Trentesaux requested to merge hugo-dev into master
1 unresolved thread
3 files
+ 54
20
Compare changes
  • Side-by-side
  • Inline
Files
3
use crate::*;
/// submit a certification and track progress
pub async fn certify(data: &Data, receiver: IdtyId) -> Result<(), anyhow::Error> {
let progress = submit_call(data, &runtime::tx().certification().add_cert(receiver)).await?;
if data.args.no_wait {
return Ok(());
}
let events = track_progress(progress).await?;
// look for the expected event
look_event::<runtime::certification::events::CertAdded>(data, &events)?;
look_event::<runtime::certification::events::CertRenewed>(data, &events)?;
Ok(())
pub async fn certify(data: &Data, target: IdtyId) -> Result<(), subxt::Error> {
submit_call_and_look_event::<
runtime::certification::events::CertAdded,
Payload<runtime::certification::calls::types::AddCert>,
>(data, &runtime::tx().certification().add_cert(target))
.await
}
/// renew certification
pub async fn renew(data: &Data, target: IdtyId) -> Result<(), subxt::Error> {
submit_call_and_look_event::<
runtime::certification::events::CertRenewed,
Payload<runtime::certification::calls::types::RenewCert>,
>(data, &runtime::tx().certification().renew_cert(target))
.await
}
Loading