Skip to content

Commit 1e1d52b

Browse files
committed
fix cargo test-all-features
1 parent 9799754 commit 1e1d52b

File tree

4 files changed

+15
-27
lines changed

4 files changed

+15
-27
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ chacha20poly1305 = "0.10.1"
1515
ed25519-dalek = { version = "2.1.0", features = ["rand_core"] }
1616
rand_chacha = { version = "0.3.1", optional = true }
1717
rand_core = "0.6.4"
18-
reddsa = { git = "https://github.com/ZcashFoundation/reddsa.git", rev = "311baf8865f6e21527d1f20750d8f2cf5c9e531a", features = ["frost", "frost-rerandomized"] }
19-
siphasher = { version = "1.0.0", features =["serde_no_std"] }
18+
reddsa = { git = "https://github.com/ZcashFoundation/reddsa.git", rev = "b9c3107e6ec5333a89a7fa064f2d10f749a90cce", features = ["frost", "frost-rerandomized"] }
19+
siphasher = { version = "1.0.0" }
2020
x25519-dalek = { version = "2.0.0", features = ["reusable_secrets", "static_secrets"] }
2121

2222
[dev-dependencies]
2323
hex-literal = "0.4.1"
2424
rand = "0.8.5"
2525

2626
[features]
27-
default = ["signing"]
27+
default = ["signing", "dkg"]
2828

2929
std = []
3030
signing = ["dep:blake3", "dep:rand_chacha", "std"]
31-
dkg = []
31+
dkg = ["signing"]

src/checksum.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,3 @@ impl fmt::Display for ChecksumError {
3030
}
3131
}
3232
}
33-
34-
#[cfg(feature = "std")]
35-
use std::error;
36-
#[cfg(feature = "std")]
37-
impl error::Error for ChecksumError {}

src/dkg/round2.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,18 +329,19 @@ impl CombinedPublicPackage {
329329
Ok(write_variable_length(
330330
writer,
331331
&self.packages,
332-
|writer, pkg| Ok(pkg.serialize_without_sender_into(writer)?),
332+
|writer, pkg| {
333+
pkg.serialize_without_sender_into(writer)
334+
.map_err(|_| io::Error::other("serialize_into failed"))
335+
},
333336
)?)
334337
}
335338

336-
pub fn deserialize_from<R: io::Read>(mut reader: R) -> io::Result<Self> {
339+
pub fn deserialize_from<R: io::Read>(mut reader: R) -> Result<Self, IronfishFrostError> {
337340
let sender_identity = Identity::deserialize_from(&mut reader)?;
338341

339342
let packages = read_variable_length(reader, move |reader| {
340-
Ok(PublicPackage::deserialize_without_sender_from(
341-
reader,
342-
sender_identity.clone(),
343-
)?)
343+
PublicPackage::deserialize_without_sender_from(reader, sender_identity.clone())
344+
.map_err(|_| io::Error::other("deserialization failed"))
344345
})?;
345346

346347
Ok(Self { packages })

src/error.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ use reddsa::frost::redjubjub::frost::Error as FrostError;
66
use reddsa::frost::redjubjub::JubjubBlake2b512;
77

88
use crate::checksum::ChecksumError;
9+
use crate::io;
910

1011
#[derive(Debug)]
1112
pub enum IronfishFrostError {
1213
InvalidInput,
1314
StdError,
14-
IoError(std::io::Error),
15+
IoError(io::Error),
1516
FrostError(FrostError<JubjubBlake2b512>),
1617
SignatureError(ed25519_dalek::SignatureError),
1718
ChecksumError(ChecksumError),
@@ -23,8 +24,8 @@ impl From<FrostError<JubjubBlake2b512>> for IronfishFrostError {
2324
}
2425
}
2526

26-
impl From<std::io::Error> for IronfishFrostError {
27-
fn from(error: std::io::Error) -> Self {
27+
impl From<io::Error> for IronfishFrostError {
28+
fn from(error: io::Error) -> Self {
2829
IronfishFrostError::IoError(error)
2930
}
3031
}
@@ -34,12 +35,3 @@ impl From<ed25519_dalek::SignatureError> for IronfishFrostError {
3435
IronfishFrostError::SignatureError(error)
3536
}
3637
}
37-
38-
impl From<IronfishFrostError> for std::io::Error {
39-
fn from(error: IronfishFrostError) -> Self {
40-
match error {
41-
IronfishFrostError::IoError(e) => e,
42-
_ => std::io::Error::new(std::io::ErrorKind::Other, format!("{:?}", error)),
43-
}
44-
}
45-
}

0 commit comments

Comments
 (0)