Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Mar 24, 2024
1 parent f05036c commit 6c408b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version = "1.8.2"

[dependencies]
# todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107
chrono = "0.4.35"
clap = "2.33"
clap-nested = "0.4.0"
chrono = "0.4.35"
env_logger = { workspace = true }
futures = { workspace = true }
geojson = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions client/src/commands/encointer_communities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ pub fn list_communities(_args: &str, matches: &ArgMatches<'_>) -> Result<(), cla
println!("number of communities: {}", names.len());
for n in names.iter() {
let loc = api.get_locations(n.cid).await.unwrap();
let cii = get_nominal_income(&api, n.cid, maybe_at).await.unwrap();
let demurrage = get_demurrage_per_block(&api, n.cid, maybe_at).await.unwrap();
let meta = get_community_metadata(&api, n.cid, maybe_at).await.unwrap();
let cii = get_nominal_income(&api, n.cid, maybe_at).await.unwrap_or_default();
let demurrage = get_demurrage_per_block(&api, n.cid, maybe_at).await.unwrap_or_default();
let meta = get_community_metadata(&api, n.cid, maybe_at).await.unwrap_or_default();
println!(
"{}: {}, locations: {}, nominal income: {} {}, demurrage: {:?}/block, {:?}",
n.cid,
Expand Down
5 changes: 4 additions & 1 deletion client/src/commands/encointer_democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ pub fn list_proposals(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:
let proposal_id =
ProposalIdType::decode(&mut key_postfix[key_postfix.len() - 16..].as_ref())
.unwrap();
println!("id: {}", proposal_id);
let proposal: Proposal<Moment> =
api.get_storage_by_key(storage_key.clone(), maybe_at).await.unwrap().unwrap();
if !matches.all_flag() && matches!(proposal.state, ProposalState::Cancelled) {
continue
}
println!("id: {}", proposal_id);
let start = DateTime::<Utc>::from_timestamp_millis(
TryInto::<i64>::try_into(proposal.start).unwrap(),
)
Expand Down
1 change: 1 addition & 0 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ fn main() {
.options(|app| {
app.setting(AppSettings::ColoredHelp)
.at_block_arg()
.all_flag()
})
.runner(commands::encointer_democracy::list_proposals),
)
Expand Down

0 comments on commit 6c408b7

Please sign in to comment.