Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğ
Ğcli-v2s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Rust
Ğcli-v2s
Merge requests
!11
refac call submission and event watch
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
refac call submission and event watch
hugo-dev
into
master
Overview
0
Commits
6
Pipelines
0
Changes
4
Merged
Hugo Trentesaux
requested to merge
hugo-dev
into
master
1 year ago
Overview
0
Commits
6
Pipelines
0
Changes
4
Expand
refac call submission and event watch
add commands
implement config formatter
document it
0
0
Merge request reports
Viewing commit
0ded4217
Prev
Next
Show latest version
4 files
+
33
−
30
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
0ded4217
refac call submission and event watch
· 0ded4217
Hugo Trentesaux
authored
1 year ago
src/commands/certification.rs
+
7
−
21
Options
@@ -2,31 +2,17 @@ use crate::*;
@@ -2,31 +2,17 @@ use crate::*;
/// submit a certification and track progress
/// submit a certification and track progress
pub
async
fn
certify
(
data
:
&
Data
,
receiver
:
u32
)
->
Result
<
(),
anyhow
::
Error
>
{
pub
async
fn
certify
(
data
:
&
Data
,
receiver
:
u32
)
->
Result
<
(),
anyhow
::
Error
>
{
let
progress
=
data
let
progress
=
submit_call
(
.client
()
data
,
.tx
()
&
runtime
::
tx
()
.cert
()
.add_cert
(
data
.idty_index
(),
receiver
),
.sign_and_submit_then_watch
(
)
&
runtime
::
tx
()
.cert
()
.add_cert
(
data
.idty_index
(),
receiver
),
.await
?
;
&
PairSigner
::
new
(
data
.keypair
()),
BaseExtrinsicParamsBuilder
::
new
(),
)
.await
?
;
if
data
.args.no_wait
{
if
data
.args.no_wait
{
return
Ok
(());
return
Ok
(());
}
}
let
events
=
track_progress
(
progress
)
.await
?
;
let
events
=
track_progress
(
progress
)
.await
?
;
// look for the expected event
// look for the expected event
let
new_cert_event
=
events
.find_first
::
<
runtime
::
cert
::
events
::
NewCert
>
()
?
;
look_event
::
<
runtime
::
cert
::
events
::
NewCert
>
(
&
events
)
?
;
let
renew_cert_event
=
events
.find_first
::
<
runtime
::
cert
::
events
::
RenewedCert
>
()
?
;
look_event
::
<
runtime
::
cert
::
events
::
RenewedCert
>
(
&
events
)
?
;
if
let
Some
(
event
)
=
new_cert_event
{
println!
(
"{event:?}"
);
}
if
let
Some
(
event
)
=
renew_cert_event
{
println!
(
"{event:?}"
);
}
Ok
(())
Ok
(())
}
}
Loading