Skip to content

Commit d44f5dc

Browse files
committed
chore: apply review comments
1 parent dae0a7f commit d44f5dc

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

internal/mithril-dmq-node/src/consumer/pallas.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<M: TryFromBytes + Debug> DmqConsumerPallas<M> {
4848
DmqClient::connect(&self.socket, self.network.code())
4949
.await
5050
.map_err(|err| anyhow!(err))
51-
.with_context(|| "PallasChainReader failed to create a new client")
51+
.with_context(|| "DmqConsumerPallas failed to create a new client")
5252
}
5353

5454
/// Gets the cached `DmqClient`, creating a new one if it does not exist.
@@ -71,7 +71,7 @@ impl<M: TryFromBytes + Debug> DmqConsumerPallas<M> {
7171
async fn drop_client(&self) -> StdResult<()> {
7272
debug!(
7373
self.logger,
74-
"Drop exsiting DMQ client";
74+
"Drop existing DMQ client";
7575
"socket" => ?self.socket,
7676
"network" => ?self.network
7777
);
@@ -103,7 +103,11 @@ impl<M: TryFromBytes + Debug> DmqConsumerPallas<M> {
103103
.await
104104
.map_err(|err| anyhow!("Failed to request notifications from DMQ server: {}", err))?;
105105

106-
let reply = client.msg_notification().recv_next_reply().await.unwrap();
106+
let reply = client
107+
.msg_notification()
108+
.recv_next_reply()
109+
.await
110+
.map_err(|err| anyhow!("Failed to receive notifications from DMQ server: {}", err))?;
107111
debug!(self.logger, "Received single signatures from DMQ"; "messages" => ?reply);
108112
if let Err(e) = client.msg_notification().send_done().await {
109113
error!(self.logger, "Failed to send Done"; "error" => ?e);

internal/mithril-dmq-node/src/publisher/pallas.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<M: TryToBytes + Debug> DmqPublisherPallas<M> {
4444
DmqClient::connect(&self.socket, magic)
4545
.await
4646
.map_err(|err| anyhow!(err))
47-
.with_context(|| "PallasChainReader failed to create a new client")
47+
.with_context(|| "DmqPublisherPallas failed to create a new client")
4848
}
4949
}
5050

@@ -119,9 +119,9 @@ mod tests {
119119

120120
// server waits for request from client and replies to it
121121
let request = server_msg.recv_next_request().await.unwrap();
122-
if let localtxsubmission::Request::Submit(_) = &request {
123-
} else {
124-
panic!("Expected a submit request, but got: {:?}", request);
122+
match &request {
123+
localtxsubmission::Request::Submit(_) => (),
124+
request => panic!("Expected a Submit request, but received: {request:?}"),
125125
}
126126
let response = if reply_success {
127127
localtxsubmission::Response::Accepted

mithril-common/src/messages/register_signature.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl RegisterSignatureMessageDmq {
9393
}
9494
}
9595

96-
/// Convert an `RegisterSignatureMessageDmq` into bytes
96+
/// Convert a `RegisterSignatureMessageDmq` into bytes
9797
///
9898
/// # Layout
9999
/// * Signed entity type length (u16)

0 commit comments

Comments
 (0)