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
Fabrice LEBON
Ğcli-v2s
Commits
e28cb96e
Commit
e28cb96e
authored
11 months ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
get cert count from cert meta (
clients/rust/gcli-v2s!28
)
* also for smith cert * get cert count from cert meta
parent
ae6b4202
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/commands/identity.rs
+23
-4
23 additions, 4 deletions
src/commands/identity.rs
with
23 additions
and
4 deletions
src/commands/identity.rs
+
23
−
4
View file @
e28cb96e
...
...
@@ -193,7 +193,9 @@ struct IdtyView {
old_owner_key
:
Vec
<
AccountId
>
,
expire_on
:
BlockNumber
,
cert_issued
:
Vec
<
String
>
,
cert_issued_count
:
u32
,
cert_received
:
Vec
<
String
>
,
cert_received_count
:
u32
,
smith
:
Option
<
SmithView
>
,
linked_account
:
Vec
<
AccountId
>
,
}
...
...
@@ -210,16 +212,14 @@ impl std::fmt::Display for IdtyView {
writeln!
(
f
,
"Certifications: issued {}, received {}"
,
self
.cert_issued
.len
(),
self
.cert_received
.len
()
self
.cert_issued_count
,
self
.cert_received_count
)
?
;
if
let
Some
(
smith
)
=
&
self
.smith
{
writeln!
(
f
,
"Smith status: {:?}"
,
smith
.status
)
?
;
writeln!
(
f
,
"Smith certs: issued {}, received {}"
,
smith
.cert_issued
.len
(),
smith
.cert_received
.len
()
smith
.cert_issued_count
,
smith
.cert_received_count
)
?
;
}
let
a
=
self
.linked_account
.len
();
...
...
@@ -234,7 +234,9 @@ impl std::fmt::Display for IdtyView {
struct
SmithView
{
status
:
SmithStatus
,
cert_issued
:
Vec
<
String
>
,
cert_issued_count
:
usize
,
cert_received
:
Vec
<
String
>
,
cert_received_count
:
usize
,
}
/// get identity
...
...
@@ -281,6 +283,19 @@ pub async fn get_identity(
"<no indexer>"
.to_string
()
});
// get cert meta
let
cert_meta
=
client
.storage
()
.at_latest
()
.await
?
.fetch
(
&
runtime
::
storage
()
.certification
()
.storage_idty_cert_meta
(
index
),
)
.await
?
.expect
(
"expected cert meta"
);
// get certs if possible
let
(
cert_issued
,
cert_received
,
linked_account
,
smith_cert_issued
,
smith_cert_received
)
=
if
let
Some
(
indexer
)
=
&
indexer
{
...
...
@@ -315,7 +330,9 @@ pub async fn get_identity(
let
smith
=
get_smith
(
client
,
index
)
.await
?
;
let
smith
=
smith
.map
(|
s
|
SmithView
{
status
:
s
.status
,
cert_issued_count
:
s
.issued_certs
.len
(),
cert_issued
:
smith_cert_issued
,
cert_received_count
:
s
.received_certs
.len
(),
cert_received
:
smith_cert_received
,
});
...
...
@@ -328,7 +345,9 @@ pub async fn get_identity(
old_owner_key
:
vec!
[],
// TODO fetch history of owner key change
expire_on
:
value
.next_scheduled
,
// TODO if zero use membership instead
cert_issued
,
cert_issued_count
:
cert_meta
.issued_count
,
cert_received
,
cert_received_count
:
cert_meta
.received_count
,
smith
,
linked_account
,
};
...
...
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