Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the correct length bound when opening a proposal #6

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ codec = { package = "parity-scale-codec", version = "3.5.0", default-features =
hex = "0.4.3"

clap = { version = "4.4.6", features = ["derive"] }
urlencoding = "2.1.3"
urlencoding = "2.1.3"
20 changes: 15 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use clap::Parser;
use codec::Encode;
use std::str::FromStr;
use subxt::{OnlineClient, PolkadotConfig};
use subxt_signer::{sr25519, SecretUri};
Expand Down Expand Up @@ -161,14 +162,23 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});

let members_query = eden::storage().technical_membership().members();
let members = api.storage().at_latest().await?.fetch(&members_query).await?.unwrap();
let members = api
.storage()
.at_latest()
.await?
.fetch(&members_query)
.await?
.unwrap();
let threshold = members.0.len() / 2 + 1;
println!("using tech committee threshold: {}", threshold);

let technical_committee =
eden::tx()
.technical_committee()
.propose(threshold as u32, technical_committee_call, 100);
let length_bound = technical_committee_call.encoded_size() as u32;

let technical_committee = eden::tx().technical_committee().propose(
threshold as u32,
technical_committee_call,
length_bound,
);

if args.dry_run {
let mocked = api.tx().call_data(&technical_committee)?;
Expand Down