Apply Daniil suggestions from code review

Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
This commit is contained in:
Pravdyvy
2026-08-10 11:50:03 +03:00
committed by GitHub
co-authored by Daniil Polyakov
parent f0c6bde312
commit 08bb09b761
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -297,8 +297,8 @@ pub fn bedrock_channel_id_b() -> ChannelId {
ChannelId::from(channel_id)
}
#[must_use]
/// Generate sequencer signing key from `u32` number via repeating le bytes 8 times.
#[must_use]
pub fn sequencer_signing_key_from_seed(seed: u32) -> [u8; 32] {
seed.to_le_bytes()
.repeat(8)
@@ -306,11 +306,11 @@ pub fn sequencer_signing_key_from_seed(seed: u32) -> [u8; 32] {
.unwrap_or_else(|_| unreachable!())
}
#[must_use]
/// Generate bedrock channel id from `u32` number via repeating le bytes 8 times.
///
/// Counting from the end of `u32` to guarantee, that it is different from
/// `sequencer_signing_key_from_seed`.
#[must_use]
pub fn bedrock_channel_id_from_seed(seed: u32) -> ChannelId {
let channel_id: [u8; 32] =
// Useless in this case, but will make clippy happy
+2 -2
View File
@@ -125,7 +125,7 @@ impl TestContext {
/// Get a builder for the test context to customize its configuration.
#[must_use]
pub fn builder(configs: Vec<MultiNodeTestContextConfig>) -> MultiZoneTestContextBuilder {
pub fn builder(configs: impl IntoIterator<Item = MultiNodeTestContextConfig>) -> MultiZoneTestContextBuilder {
MultiZoneTestContextBuilder {
zone_builders: configs
.into_iter()
@@ -173,9 +173,9 @@ impl TestContext {
.map(|zone| zone.sequencers.iter())
}
#[must_use]
/// Reference for the default sequencer component for a zone (in case, if only one sequencer
/// exists).
#[must_use]
pub fn zone_default_sequencer_component(&self, channel_id: ChannelId) -> &SequencerComponents {
self.sequencer_components_iter(channel_id)
.unwrap()