Skip to content

Commit b2c8113

Browse files
committed
fix
1 parent 7ff060c commit b2c8113

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

Cargo.lock

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

catalyst-toolbox/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ graphql_client = { version = "0.10" }
6262
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"
65-
snapshot-lib = { path = "../snapshot-lib", features = ["serde"] }
65+
snapshot-lib = { path = "../snapshot-lib" }
6666
fraction = "0.10"
6767

6868
[dev-dependencies]
@@ -74,7 +74,7 @@ chain-vote = { git = "https://github.com/input-output-hk/chain-libs.git", branch
7474
proptest = { git = "https://github.com/input-output-hk/proptest", branch = "master" }
7575
test-strategy = "0.2"
7676
serde_test = "1"
77-
snapshot-lib = { path = "../snapshot-lib", features = ["serde", "proptest"] }
77+
snapshot-lib = { path = "../snapshot-lib", features = ["proptest"] }
7878
vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", branch = "master" }
7979

8080
[build-dependencies]

snapshot-lib/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ license = "MIT OR Apache-2.0"
1010

1111
[dependencies]
1212
jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", branch = "master" }
13-
serde = { version = "1", features = ["derive"], optional = true }
13+
serde = { version = "1", features = ["derive"] }
1414
proptest = { git = "https://github.com/input-output-hk/proptest.git", branch = "master", optional = true }
15+
chain-addr = { git = "https://github.com/input-output-hk/chain-libs.git", branch = "master", optional = true }
16+
test-strategy = { version = "0.2", optional = true }
17+
serde_test = { version = "1", optional = true }
1518
hex = { version = "0.4" }
1619
thiserror = "1.0"
1720
fraction = "0.10"
@@ -27,7 +30,9 @@ serde_test = "1"
2730
test-strategy = "0.2"
2831
serde_json = "1.0"
2932
serde_yaml = "0.8.17"
33+
proptest = { git = "https://github.com/input-output-hk/proptest.git", branch = "master" }
3034
chain-addr = { git = "https://github.com/input-output-hk/chain-libs.git", branch = "master" }
3135

3236
[features]
33-
proptest = ["dep:proptest"]
37+
proptest = ["dep:proptest", "dep:chain-addr", "dep:test-strategy", "dep:serde_test"]
38+
test-api = []

snapshot-lib/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ impl Snapshot {
177177
}
178178
}
179179

180-
#[cfg(test)]
181-
mod tests {
180+
#[cfg(any(test, feature = "proptest"))]
181+
pub mod tests {
182182
use super::*;
183183
use chain_addr::{Discrimination, Kind};
184184
use jormungandr_lib::interfaces::{Address, InitialUTxO};

snapshot-lib/src/registration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ mod deser {
136136
}
137137
}
138138

139-
#[cfg(test)]
139+
#[cfg(any(test, feature = "proptest"))]
140140
mod tests {
141141
use super::deser::IdentifierDef;
142142
use super::*;

snapshot-lib/src/voter_hir.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#[cfg(feature = "serde")]
21
use ::serde::{Deserialize, Serialize};
32
use jormungandr_lib::{crypto::account::Identifier, interfaces::Value};
43

@@ -13,11 +12,10 @@ pub type VotingGroup = String;
1312
///
1413
/// You can roughly read this as
1514
/// "voting_key will participate in this voting round with role voting_group and will have voting_power influence"
16-
#[derive(Debug, Clone, PartialEq, Hash, Eq)]
17-
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15+
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
1816
pub struct VoterHIR {
1917
// Keep hex encoding as in CIP-36
20-
#[cfg_attr(feature = "serde", serde(with = "serde"))]
18+
#[serde(with = "serde")]
2119
pub voting_key: Identifier,
2220
/// Voting group this key belongs to.
2321
/// If this key belong to multiple voting groups, multiple records for the same
@@ -27,7 +25,6 @@ pub struct VoterHIR {
2725
pub voting_power: Value,
2826
}
2927

30-
#[cfg(feature = "serde")]
3128
mod serde {
3229
use super::*;
3330
use ::serde::{de::Error, Deserializer, Serializer};

snapshot-lib/src/voting_group.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl VotingGroupAssigner for RepsVotersAssigner {
7171
}
7272
}
7373

74-
#[cfg(any(test, feature = "test-api"))]
74+
#[cfg(any(test, feature = "test-api", feature = "proptest"))]
7575
impl<F> VotingGroupAssigner for F
7676
where
7777
F: Fn(&Identifier) -> VotingGroup,

0 commit comments

Comments
 (0)