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
Commits
b2027c2c
Commit
b2027c2c
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
listen promoted to smith event
parent
e23868d8
No related branches found
No related tags found
1 merge request
!15
update to runtime 800
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+8
-0
8 additions, 0 deletions
README.md
src/commands/smith.rs
+20
-5
20 additions, 5 deletions
src/commands/smith.rs
src/display.rs
+5
-0
5 additions, 0 deletions
src/display.rs
with
33 additions
and
5 deletions
README.md
+
8
−
0
View file @
b2027c2c
...
@@ -73,4 +73,12 @@ Secret key format can be changed using `--secret-format` with the following valu
...
@@ -73,4 +73,12 @@ Secret key format can be changed using `--secret-format` with the following valu
-
[x] add link/unlink account commands
-
[x] add link/unlink account commands
-
[ ] migrate all xt to submit_call_and_look_event
-
[ ] migrate all xt to submit_call_and_look_event
-
[ ] add transfer with unit (ĞD, UD...)
-
[ ] add transfer with unit (ĞD, UD...)
-
[ ] add more runtime-info like cert count, sudo key...
-
[ ] add more info on identity view like status, number certs emitted, received
-
[ ] implement squid indexer to get cert list + tx history...
-
[ ]
-
[ ]
-
[ ]
-
[ ]
-
[ ]
-
[ ]
-
[ ]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/commands/smith.rs
+
20
−
5
View file @
b2027c2c
...
@@ -289,9 +289,24 @@ pub async fn accept_invitation(data: &Data) -> Result<(), subxt::Error> {
...
@@ -289,9 +289,24 @@ pub async fn accept_invitation(data: &Data) -> Result<(), subxt::Error> {
/// invite identity to join smith
/// invite identity to join smith
pub
async
fn
certify_smith
(
data
:
&
Data
,
target
:
IdtyId
)
->
Result
<
(),
subxt
::
Error
>
{
pub
async
fn
certify_smith
(
data
:
&
Data
,
target
:
IdtyId
)
->
Result
<
(),
subxt
::
Error
>
{
submit_call_and_look_event
::
<
// submit_call_and_look_event::<
runtime
::
smith_members
::
events
::
CertificationReceived
,
// runtime::smith_members::events::CertificationReceived,
Payload
<
runtime
::
smith_members
::
calls
::
types
::
CertifySmith
>
,
// Payload<runtime::smith_members::calls::types::CertifySmith>,
>
(
data
,
&
runtime
::
tx
()
.smith_members
()
.certify_smith
(
target
))
// >(data, &runtime::tx().smith_members().certify_smith(target))
.await
// .await
let
progress
=
submit_call
(
data
,
&
runtime
::
tx
()
.smith_members
()
.certify_smith
(
target
),
)
.await
?
;
if
data
.args.no_wait
{
return
Ok
(());
}
let
events
=
track_progress
(
progress
)
.await
?
;
// look for the expected event
look_event
::
<
runtime
::
smith_members
::
events
::
CertificationReceived
>
(
data
,
&
events
)
?
;
look_event
::
<
runtime
::
smith_members
::
events
::
PromotedToSmith
>
(
data
,
&
events
)
?
;
Ok
(())
}
}
This diff is collapsed.
Click to expand it.
src/display.rs
+
5
−
0
View file @
b2027c2c
...
@@ -75,6 +75,11 @@ impl DisplayEvent for runtime::smith_members::events::CertificationReceived {
...
@@ -75,6 +75,11 @@ impl DisplayEvent for runtime::smith_members::events::CertificationReceived {
format!
(
"new smith certification {:?}"
,
self
)
format!
(
"new smith certification {:?}"
,
self
)
}
}
}
}
impl
DisplayEvent
for
runtime
::
smith_members
::
events
::
PromotedToSmith
{
fn
display
(
&
self
,
_data
:
&
Data
)
->
String
{
format!
(
"new smith promoted {:?}"
,
self
)
}
}
impl
DisplayEvent
for
runtime
::
identity
::
events
::
IdtyRemoved
{
impl
DisplayEvent
for
runtime
::
identity
::
events
::
IdtyRemoved
{
fn
display
(
&
self
,
_data
:
&
Data
)
->
String
{
fn
display
(
&
self
,
_data
:
&
Data
)
->
String
{
format!
(
"identity removed {:?}"
,
self
)
format!
(
"identity removed {:?}"
,
self
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment