Skip to content
Snippets Groups Projects

refac call submission and event watch

Merged Hugo Trentesaux requested to merge hugo-dev into master
6 files
+ 63
143
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 10
22
@@ -135,26 +135,14 @@ pub async fn technical_committee_vote(
proposal_index: u32,
vote: bool,
) -> Result<(), subxt::Error> {
let progress = data
.client()
.tx()
.sign_and_submit_then_watch(
&runtime::tx()
.technical_committee()
.vote(proposal_hash, proposal_index, vote),
&PairSigner::new(data.keypair()),
BaseExtrinsicParamsBuilder::new(),
)
.await?;
if data.args.no_wait {
return Ok(());
}
let events = track_progress(progress).await?;
if let Some(e) = events.find_first::<runtime::technical_committee::events::Voted>()? {
println!("{e:?}");
}
Ok(())
submit_call_and_look_event::<
runtime::technical_committee::events::Voted,
StaticTxPayload<runtime::technical_committee::calls::Vote>,
>(
data,
&runtime::tx()
.technical_committee()
.vote(proposal_hash, proposal_index, vote),
)
.await
}
Loading