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
21a9b4e4
Verified
Commit
21a9b4e4
authored
2 years ago
by
Pascal Engélibert
Browse files
Options
Downloads
Patches
Plain Diff
feat: tech-proposals command
parent
d3df09f2
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cargo.lock
+147
-184
147 additions, 184 deletions
Cargo.lock
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
src/commands/collective.rs
+29
-0
29 additions, 0 deletions
src/commands/collective.rs
src/main.rs
+4
-0
4 additions, 0 deletions
src/main.rs
with
181 additions
and
185 deletions
Cargo.lock
+
147
−
184
View file @
21a9b4e4
This diff is collapsed.
Click to expand it.
Cargo.toml
+
1
−
1
View file @
21a9b4e4
...
...
@@ -8,7 +8,7 @@ version = "0.1.0"
[dependencies]
anyhow
=
"1.0"
clap
=
{
version
=
"4.
0
"
,
features
=
[
"derive"
]
}
clap
=
{
version
=
"4.
1.8
"
,
features
=
[
"derive"
]
}
codec
=
{
package
=
"parity-scale-codec"
,
version
=
"3.1.5"
}
env_logger
=
"0.10"
futures
=
"0.3.25"
...
...
This diff is collapsed.
Click to expand it.
src/commands/collective.rs
+
29
−
0
View file @
21a9b4e4
...
...
@@ -57,3 +57,32 @@ pub async fn technical_committee_members(client: Client, args: &Args) -> Result<
Ok
(())
}
// TODO:
// * better formatting (format pubkeys to SS58 and add usernames)
// * display proposals indices
pub
async
fn
technical_committee_proposals
(
client
:
Client
)
->
Result
<
()
>
{
let
parent_hash
=
client
.storage
()
.fetch
(
&
gdev
::
storage
()
.system
()
.parent_hash
(),
None
)
.await
?
.unwrap
();
let
mut
proposals_iter
=
client
.storage
()
.iter
(
gdev
::
storage
()
.technical_committee
()
.proposal_of
(
sp_core
::
H256
::
default
()),
10
,
Some
(
parent_hash
),
)
.await
?
;
while
let
Some
((
proposal_hash
,
proposal
))
=
proposals_iter
.next
()
.await
?
{
println!
(
"{}"
,
hex
::
encode
(
&
proposal_hash
.0
[
32
..
64
]));
println!
(
"{proposal:#?}"
);
println!
();
}
Ok
(())
}
This diff is collapsed.
Click to expand it.
src/main.rs
+
4
−
0
View file @
21a9b4e4
...
...
@@ -142,6 +142,7 @@ pub enum Subcommand {
},
/// List members of the technical committee
TechMembers
,
TechProposals
,
Transfer
{
/// Amount to transfer
amount
:
u64
,
...
...
@@ -316,6 +317,9 @@ async fn main() -> Result<()> {
Subcommand
::
TechMembers
=>
{
commands
::
collective
::
technical_committee_members
(
client
,
&
args
)
.await
?
}
Subcommand
::
TechProposals
=>
{
commands
::
collective
::
technical_committee_proposals
(
client
)
.await
?
}
Subcommand
::
Transfer
{
amount
,
dest
,
...
...
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