Skip to content
Snippets Groups Projects
Verified Commit 21a9b4e4 authored by Pascal Engélibert's avatar Pascal Engélibert :bicyclist:
Browse files

feat: tech-proposals command

parent d3df09f2
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -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"
......
......@@ -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(())
}
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment