Skip to content

Commit bc5239a

Browse files
authored
Merge pull request #162 from input-output-hk/feature/npg-2640-update-snapshot-lib
Update snapshot lib
2 parents d0bf935 + a8490f8 commit bc5239a

File tree

14 files changed

+31
-33
lines changed

14 files changed

+31
-33
lines changed

Cargo.lock

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

catalyst-toolbox/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ gag = "1"
6363
vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", branch = "master" }
6464
env_logger = "0.9"
6565
snapshot-lib = { path = "../snapshot-lib" }
66-
fraction = "0.10"
6766

6867
[dev-dependencies]
6968
rand_chacha = "0.3"

catalyst-toolbox/src/bin/cli/kedqr/decode/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::path::PathBuf;
1010
use structopt::StructOpt;
1111

1212
/// QCode CLI toolkit
13-
#[derive(Debug, PartialEq, StructOpt)]
13+
#[derive(Debug, PartialEq, Eq, StructOpt)]
1414
#[structopt(rename_all = "kebab-case")]
1515
pub struct DecodeQrCodeCmd {
1616
/// Path to file containing img or payload.

catalyst-toolbox/src/bin/cli/kedqr/encode/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::path::PathBuf;
1010
use structopt::StructOpt;
1111

1212
/// QCode CLI toolkit
13-
#[derive(Debug, PartialEq, StructOpt)]
13+
#[derive(Debug, PartialEq, Eq, StructOpt)]
1414
#[structopt(rename_all = "kebab-case")]
1515
pub struct EncodeQrCodeCmd {
1616
/// Path to file containing ed25519extended bech32 value.

catalyst-toolbox/src/bin/cli/kedqr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl QrCodeCmd {
3131
}
3232
}
3333

34-
#[derive(Debug, PartialEq, StructOpt)]
34+
#[derive(Debug, PartialEq, Eq, StructOpt)]
3535
#[structopt(rename_all = "kebab-case")]
3636
pub enum QrCodeOpts {
3737
Img,

catalyst-toolbox/src/bin/cli/snapshot/mod.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use color_eyre::Report;
2-
use fraction::Fraction;
32
use jcli_lib::utils::{output_file::OutputFile, output_format::OutputFormat};
43
use jormungandr_lib::interfaces::Value;
5-
use snapshot_lib::{voting_group::RepsVotersAssigner, RawSnapshot, Snapshot};
4+
use snapshot_lib::Fraction;
5+
use snapshot_lib::{
6+
voting_group::{RepsVotersAssigner, DEFAULT_DIRECT_VOTER_GROUP, DEFAULT_REPRESENTATIVE_GROUP},
7+
RawSnapshot, Snapshot,
8+
};
69
use std::fs::File;
710
use std::io::Write;
811
use std::path::PathBuf;
912
use structopt::StructOpt;
1013

11-
const DEFAULT_DIRECT_VOTER_GROUP: &str = "direct";
12-
const DEFAULT_REPRESENTATIVE_GROUP: &str = "rep";
13-
1414
/// Process raw registrations into blockchain initials
1515
#[derive(StructOpt)]
1616
#[structopt(rename_all = "kebab-case")]
@@ -32,10 +32,6 @@ pub struct SnapshotCmd {
3232
#[structopt(long)]
3333
representatives_group: Option<String>,
3434

35-
/// Url of the representative db api server
36-
#[structopt(long)]
37-
reps_db_api_url: reqwest::Url,
38-
3935
/// Voting power cap for each account
4036
#[structopt(short, long)]
4137
voting_power_cap: Fraction,
@@ -56,7 +52,7 @@ impl SnapshotCmd {
5652
let representative = self
5753
.representatives_group
5854
.unwrap_or_else(|| DEFAULT_REPRESENTATIVE_GROUP.into());
59-
let assigner = RepsVotersAssigner::new(direct_voter, representative, self.reps_db_api_url)?;
55+
let assigner = RepsVotersAssigner::new(direct_voter, representative);
6056
let initials = Snapshot::from_raw_snapshot(
6157
raw_snapshot,
6258
self.min_stake_threshold,

catalyst-toolbox/src/bin/cli/vote_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::path::PathBuf;
1212
/// Verify that your votes were correctly tallied.
1313
///
1414
/// Requires Jormungandr to be installed in the system
15-
#[derive(Debug, PartialEq, StructOpt)]
15+
#[derive(Debug, PartialEq, Eq, StructOpt)]
1616
#[structopt(rename_all = "kebab-case")]
1717
pub struct VoteCheck {
1818
/// Path to folder containing the full blockchain history saved in Jormungandr

catalyst-toolbox/src/community_advisors/models/de.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct AdvisorReviewRow {
3737
filtered_out: bool,
3838
}
3939

40-
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
40+
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
4141
pub struct VeteranRankingRow {
4242
pub proposal_id: String,
4343
#[serde(alias = "Assessor")]

catalyst-toolbox/src/kedqr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use thiserror::Error;
99

1010
pub const PIN_LENGTH: usize = 4;
1111

12-
#[derive(Debug, PartialEq)]
12+
#[derive(Debug, PartialEq, Eq)]
1313
pub struct QrPin {
1414
pub password: [u8; 4],
1515
}

catalyst-toolbox/src/rewards/voters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ pub fn calc_voter_rewards(
191191
mod tests {
192192
use super::*;
193193
use crate::utils::assert_are_close;
194-
use fraction::Fraction;
195194
use jormungandr_lib::crypto::account::Identifier;
196195
use snapshot_lib::registration::{Delegations, VotingRegistration};
196+
use snapshot_lib::Fraction;
197197
use snapshot_lib::Snapshot;
198198
use test_strategy::proptest;
199199

0 commit comments

Comments
 (0)