Skip to content
Snippets Groups Projects
certification.rs 520 B
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().cert().add_cert(data.idty_index(), receiver),
	)
	.await?;
	if data.args.no_wait {
		return Ok(());
	}
	let events = track_progress(progress).await?;
	// look for the expected event
	look_event::<runtime::cert::events::NewCert>(data, &events)?;
	look_event::<runtime::cert::events::RenewedCert>(data, &events)?;
	Ok(())
}