Skip to content

Commit 5000163

Browse files
authored
Remove unused RawOutgoingMessage struct (#3875)
## Motivation While working through the `Resource`(`Tracker`) code I noticed we map `SendMessageRequest` to this struct but it wasn't used anywhere. ## Proposal Remove unused struct. It seems like what we use instead is `SendMessageRequest<Vec<u8>>`. ## Test Plan N/A ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links
1 parent ec44c26 commit 5000163

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

linera-execution/src/lib.rs

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use linera_base::{
3535
crypto::{BcsHashable, CryptoHash},
3636
data_types::{
3737
Amount, ApplicationDescription, ApplicationPermissions, ArithmeticError, Blob, BlockHeight,
38-
DecompressionError, Epoch, Resources, SendMessageRequest, StreamUpdate, Timestamp,
38+
DecompressionError, Epoch, SendMessageRequest, StreamUpdate, Timestamp,
3939
},
4040
doc_scalar, hex_debug, http,
4141
identifiers::{
@@ -913,48 +913,6 @@ pub enum QueryResponse {
913913
),
914914
}
915915

916-
/// A message together with routing information.
917-
#[derive(Clone, Debug)]
918-
#[cfg_attr(with_testing, derive(Eq, PartialEq))]
919-
pub struct RawOutgoingMessage<Message, Grant> {
920-
/// The destination of the message.
921-
pub destination: ChainId,
922-
/// Whether the message is authenticated.
923-
pub authenticated: bool,
924-
/// The grant needed for message execution, typically specified as an `Amount` or as `Resources`.
925-
pub grant: Grant,
926-
/// The kind of outgoing message being sent.
927-
pub kind: MessageKind,
928-
/// The message itself.
929-
pub message: Message,
930-
}
931-
932-
impl<Message> From<SendMessageRequest<Message>> for RawOutgoingMessage<Message, Resources> {
933-
fn from(request: SendMessageRequest<Message>) -> Self {
934-
let SendMessageRequest {
935-
destination,
936-
authenticated,
937-
grant,
938-
is_tracked,
939-
message,
940-
} = request;
941-
942-
let kind = if is_tracked {
943-
MessageKind::Tracked
944-
} else {
945-
MessageKind::Simple
946-
};
947-
948-
RawOutgoingMessage {
949-
destination,
950-
authenticated,
951-
grant,
952-
kind,
953-
message,
954-
}
955-
}
956-
}
957-
958916
/// The kind of outgoing message being sent.
959917
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize, Copy)]
960918
pub enum MessageKind {

0 commit comments

Comments
 (0)