Skip to content

Commit f26783d

Browse files
committed
deleted vs folder, ran clippy & fmt
1 parent 29bbbf7 commit f26783d

File tree

8 files changed

+26
-32
lines changed

8 files changed

+26
-32
lines changed

.vs/ProjectSettings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vs/VSWorkspaceState.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Binary file not shown.

.vs/catalyst-toolbox/FileContentIndex/read.lock

Whitespace-only changes.

.vs/catalyst-toolbox/v17/.suo

-30 KB
Binary file not shown.

.vs/slnx.sqlite

-96 KB
Binary file not shown.

catalyst-toolbox/src/rewards/voters.rs

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,22 @@ mod tests {
136136
use crate::utils::assert_are_close;
137137
use jormungandr_lib::crypto::{account::Identifier, hash::Hash};
138138
use snapshot_lib::registration::{Delegations, VotingRegistration};
139-
use snapshot_lib::{Fraction, RawSnapshot};
140139
use snapshot_lib::Snapshot;
140+
use snapshot_lib::{Fraction, RawSnapshot};
141141
use test_strategy::proptest;
142142

143-
const DEFAULT_TEST_THRESHOLD:usize = 1;
144-
const DEFAULT_SNAPSHOT_THRESHOLD:u64 = 1;
143+
const DEFAULT_TEST_THRESHOLD: usize = 1;
144+
const DEFAULT_SNAPSHOT_THRESHOLD: u64 = 1;
145145

146146
#[proptest]
147147
fn test_all_active_voters(raw_snapshot: RawSnapshot) {
148-
149148
let snapshot = Snapshot::from_raw_snapshot(
150149
raw_snapshot,
151150
DEFAULT_SNAPSHOT_THRESHOLD.into(),
152151
Fraction::from(1),
153-
&|_vk: &Identifier| String::new()
154-
).unwrap();
152+
&|_vk: &Identifier| String::new(),
153+
)
154+
.unwrap();
155155

156156
let votes_count = snapshot
157157
.voting_keys()
@@ -169,7 +169,8 @@ mod tests {
169169
Rewards::ONE,
170170
)
171171
.unwrap();
172-
if number_of_voters > 0 { // number of voters always 0 ???
172+
if number_of_voters > 0 {
173+
// number of voters always 0 ???
173174
assert_are_close(rewards.values().sum::<Rewards>(), Rewards::ONE)
174175
} else {
175176
assert_eq!(rewards.len(), 0);
@@ -178,13 +179,13 @@ mod tests {
178179

179180
#[proptest]
180181
fn test_all_inactive_voters(raw_snapshot: RawSnapshot) {
181-
182182
let snapshot = Snapshot::from_raw_snapshot(
183183
raw_snapshot,
184184
DEFAULT_SNAPSHOT_THRESHOLD.into(),
185185
Fraction::from(1),
186-
&|_vk: &Identifier| String::new()
187-
).unwrap();
186+
&|_vk: &Identifier| String::new(),
187+
)
188+
.unwrap();
188189

189190
let votes_count = VoteCount::new();
190191

@@ -201,13 +202,13 @@ mod tests {
201202

202203
#[proptest]
203204
fn test_active_and_inactive_voters(raw_snapshot: RawSnapshot) {
204-
205205
let snapshot = Snapshot::from_raw_snapshot(
206206
raw_snapshot,
207207
DEFAULT_SNAPSHOT_THRESHOLD.into(),
208208
Fraction::from(1),
209-
&|_vk: &Identifier| String::new()
210-
).unwrap();
209+
&|_vk: &Identifier| String::new(),
210+
)
211+
.unwrap();
211212

212213
let voting_keys = snapshot.voting_keys().collect::<Vec<_>>();
213214

@@ -217,7 +218,8 @@ mod tests {
217218
.map(|(i, &key)| {
218219
(
219220
key.to_owned(),
220-
if i % 2 == 0 { // generating a random set of half active & half inactive votes
221+
if i % 2 == 0 {
222+
// generating a random set of half active & half inactive votes
221223
HashSet::from([Hash::from([0u8; 32])])
222224
} else {
223225
HashSet::new()
@@ -385,13 +387,13 @@ mod tests {
385387

386388
#[proptest]
387389
fn test_per_category_threshold(raw_snapshot: RawSnapshot) {
388-
389390
let snapshot = Snapshot::from_raw_snapshot(
390391
raw_snapshot,
391392
DEFAULT_SNAPSHOT_THRESHOLD.into(),
392393
Fraction::from(1),
393-
&|_vk: &Identifier| String::new()
394-
).unwrap();
394+
&|_vk: &Identifier| String::new(),
395+
)
396+
.unwrap();
395397

396398
use vit_servicing_station_tests::common::data::ArbitrarySnapshotGenerator;
397399

@@ -447,7 +449,12 @@ mod tests {
447449
let rewards = calc_voter_rewards(
448450
votes_count,
449451
voters.clone(),
450-
Threshold::new(DEFAULT_TEST_THRESHOLD, per_challenge_threshold.clone(), proposals.clone()).unwrap(),
452+
Threshold::new(
453+
DEFAULT_TEST_THRESHOLD,
454+
per_challenge_threshold.clone(),
455+
proposals.clone(),
456+
)
457+
.unwrap(),
451458
Rewards::ONE,
452459
)
453460
.unwrap();

snapshot-lib/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
pub use fraction::Fraction;
22
use jormungandr_lib::{crypto::account::Identifier, interfaces::Value};
3+
use proptest::prelude::Arbitrary;
34
use registration::{Delegations, MainnetRewardAddress, VotingRegistration};
45
use serde::{Deserialize, Serialize};
56
use std::{borrow::Borrow, collections::BTreeMap, iter::Iterator, num::NonZeroU64};
6-
use proptest::prelude::Arbitrary;
77
use thiserror::Error;
88
pub use voter_hir::VoterHIR;
99
pub use voter_hir::VotingGroup;
@@ -243,7 +243,6 @@ pub mod tests {
243243
);
244244
}
245245

246-
247246
impl Arbitrary for Snapshot {
248247
type Parameters = ();
249248
type Strategy = BoxedStrategy<Snapshot>;

0 commit comments

Comments
 (0)