mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-25 11:21:12 +00:00
Apply Daniil suggestions from code review
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
This commit is contained in:
co-authored by
Daniil Polyakov
parent
f0c6bde312
commit
08bb09b761
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user