Minor fixups.

This commit is contained in:
parazyd
2022-04-21 19:06:47 +02:00
parent 72f6ad0e59
commit c2c7039cdf
4 changed files with 10 additions and 3 deletions

View File

@@ -335,6 +335,13 @@ impl From<VerifyFailed> for ClientFailed {
}
}
#[cfg(feature = "net2")]
impl<T: std::fmt::Display> From<crate::net2::transport::TransportError<T>> for Error {
fn from(err: crate::net2::transport::TransportError<T>) -> Self {
Self::TransportError(err.to_string())
}
}
impl From<std::io::Error> for Error {
fn from(err: std::io::Error) -> Self {
Self::Io(err.kind())

View File

@@ -62,7 +62,7 @@ impl<T: Transport> ProtocolPing<T> {
debug!(target: "net", "ProtocolPing::run_ping_pong() [START]");
loop {
// Wait channel_heartbeat amount of time.
sleep(self.settings.channel_heartbeat_seconds).await;
sleep(self.settings.channel_heartbeat_seconds.into()).await;
// Create a random nonce.
let nonce = Self::random_nonce();

View File

@@ -98,7 +98,7 @@ impl<T: Transport> ManualSession<T> {
Err(err) => {
info!(target: "net", "Unable to connect to manual outbound [{}]: {}", addr, err);
sleep(settings.connect_timeout_seconds).await;
sleep(settings.connect_timeout_seconds.into()).await;
}
}
}

View File

@@ -412,7 +412,7 @@ mod tests {
let coin = Coin(pallas::Base::random(&mut OsRng));
let nullifier = Nullifier::new(*s, serial);
let leaf_position = 0;
let leaf_position: incrementalmerkletree::Position = 0.into();
OwnCoin { coin, note, secret: *s, nullifier, leaf_position }
}