Skip to content

Commit

Permalink
refactor: rename chunk_id->message_id (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-starkware committed Sep 22, 2024
1 parent e26b0ea commit f68bd90
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/papyrus_protobuf/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl ConsensusMessage {
pub struct StreamMessage<T: Into<Vec<u8>> + TryFrom<Vec<u8>, Error = ProtobufConversionError>> {
pub message: T,
pub stream_id: u64,
pub chunk_id: u64,
pub message_id: u64,
pub fin: bool,
}

Expand Down
4 changes: 2 additions & 2 deletions crates/papyrus_protobuf/src/converters/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl<T: Into<Vec<u8>> + TryFrom<Vec<u8>, Error = ProtobufConversionError>>
Ok(Self {
message: T::try_from(value.message)?,
stream_id: value.stream_id,
chunk_id: value.chunk_id,
message_id: value.message_id,
fin: value.fin,
})
}
Expand All @@ -134,7 +134,7 @@ impl<T: Into<Vec<u8>> + TryFrom<Vec<u8>, Error = ProtobufConversionError>> From<
Self {
message: value.message.into(),
stream_id: value.stream_id,
chunk_id: value.chunk_id,
message_id: value.message_id,
fin: value.fin,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/papyrus_protobuf/src/converters/consensus_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl GetTestInstance for StreamMessage<ConsensusMessage> {
Self {
message: ConsensusMessage::Proposal(Proposal::default()),
stream_id: rng.gen_range(0..100),
chunk_id: rng.gen_range(0..1000),
message_id: rng.gen_range(0..1000),
fin: rng.gen_bool(0.5),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ message ConsensusMessage {
message StreamMessage {
bytes message = 1;
uint64 stream_id = 2;
uint64 chunk_id = 3;
uint64 message_id = 3;
bool fin = 4;
}

0 comments on commit f68bd90

Please sign in to comment.