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::*;
use crate::*;
/// submit a certification and track progress
/// submit a certification and track progress
pub async fn certify(data: &Data, receiver: IdtyId) -> Result<(), anyhow::Error> {
pub async fn certify(data: &Data, target: IdtyId) -> Result<(), subxt::Error> {
let progress = submit_call(data, &runtime::tx().certification().add_cert(receiver)).await?;
submit_call_and_look_event::<
if data.args.no_wait {
runtime::certification::events::CertAdded,
return Ok(());
Payload<runtime::certification::calls::types::AddCert>,
}
>(data, &runtime::tx().certification().add_cert(target))
let events = track_progress(progress).await?;
.await
// look for the expected event
}
look_event::<runtime::certification::events::CertAdded>(data, &events)?;
look_event::<runtime::certification::events::CertRenewed>(data, &events)?;
/// renew certification
Ok(())
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