diff --git a/crates/configuration/src/global_settings.rs b/crates/configuration/src/global_settings.rs index b6bdf7978982fa45d5e98921d45c3657fef9dc04..11a85c2d84a01450c4f73fee07a6a8a1f707cef7 100644 --- a/crates/configuration/src/global_settings.rs +++ b/crates/configuration/src/global_settings.rs @@ -138,7 +138,7 @@ impl GlobalSettingsBuilder { } } - /// Seal the builder and returns a `GlobalSettings` if there are no validation errors, else returns errors. + /// Seals the builder and returns a `GlobalSettings` if there are no validation errors, else returns errors. pub fn build(self) -> Result<GlobalSettings, Vec<anyhow::Error>> { if !self.errors.is_empty() { return Err(self diff --git a/crates/configuration/src/hrmp_channel.rs b/crates/configuration/src/hrmp_channel.rs index 613ff8636ff0354e84577cbc41fc1fe25d33af5a..c07c9777d107beaceba3f05b99e5e18f2dac2fe2 100644 --- a/crates/configuration/src/hrmp_channel.rs +++ b/crates/configuration/src/hrmp_channel.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; use crate::shared::{macros::states, types::ParaId}; -/// A HRMP channel configuration, with fine-grained configuration options. +/// HRMP channel configuration, with fine-grained configuration options. #[derive(Debug, Clone, PartialEq)] pub struct HrmpChannelConfig { sender: ParaId, @@ -39,7 +39,7 @@ states! { WithRecipient } -/// A HRMP channel configuration builder, used to build a `HrmpChannelConfig` declaratively with fields validation. +/// HRMP channel configuration builder, used to build an `HrmpChannelConfig` declaratively with fields validation. #[derive(Debug)] pub struct HrmpChannelConfigBuilder<State> { config: HrmpChannelConfig, diff --git a/crates/configuration/src/network.rs b/crates/configuration/src/network.rs index d8c7b681efcbee63c823bb078265bb4bb060688e..572f52fb74197477099df577e619d097c794a285 100644 --- a/crates/configuration/src/network.rs +++ b/crates/configuration/src/network.rs @@ -23,7 +23,7 @@ impl NetworkConfig { &self.global_settings } - /// The relaychain of the network. + /// The relay chain of the network. pub fn relaychain(&self) -> &RelaychainConfig { self.relaychain .as_ref() @@ -156,7 +156,7 @@ impl NetworkConfigBuilder<Initial> { Self::default() } - /// Set the relaychain using a nested ```RelaychainConfigBuilder```. + /// Set the relay chainusing a nested ```RelaychainConfigBuilder```. pub fn with_relaychain( self, f: fn( @@ -213,7 +213,7 @@ impl NetworkConfigBuilder<WithRelaychain> { } } - /// Add a HRMP channel using a nested ```HrmpChannelConfigBuilder```. + /// Add an HRMP channel using a nested ```HrmpChannelConfigBuilder```. pub fn with_hrmp_channel( self, f: fn( @@ -231,7 +231,7 @@ impl NetworkConfigBuilder<WithRelaychain> { ) } - /// Seal the builder and returns a `NetworkConfig` if there are no validation errors, else returns errors. + /// Seals the builder and returns a `NetworkConfig` if there are no validation errors, else returns errors. pub fn build(self) -> Result<NetworkConfig, Vec<anyhow::Error>> { if !self.errors.is_empty() { return Err(self.errors); diff --git a/crates/configuration/src/parachain.rs b/crates/configuration/src/parachain.rs index 1bb78fe2f2e2ce4b8b7ea1036beb4f76e6b2d487..64df23569f86d3bd8b1f515e21b4087f4933ea42 100644 --- a/crates/configuration/src/parachain.rs +++ b/crates/configuration/src/parachain.rs @@ -80,7 +80,7 @@ impl ParachainConfig { self.default_db_snapshot.as_ref() } - /// The default args that will be used to execute the collator command. + /// The default arguments that will be used to execute the collator command. pub fn default_args(&self) -> Vec<&Arg> { self.default_args.iter().collect::<Vec<&Arg>>() } @@ -105,12 +105,12 @@ impl ParachainConfig { self.genesis_state_generator.as_ref() } - /// The location of an pre-existing chain spec for the parachain. + /// The location of a pre-existing chain specification for the parachain. pub fn chain_spec_path(&self) -> Option<&AssetLocation> { self.chain_spec_path.as_ref() } - /// Wether the parachain is based on cumulus. + /// Whether the parachain is based on cumulus. pub fn is_cumulus_based(&self) -> bool { self.is_cumulus_based } @@ -207,7 +207,7 @@ impl ParachainConfigBuilder<Initial> { impl ParachainConfigBuilder<WithId> { /// Set the chain name (e.g. rococo-local). /// Use ```None```, if you are running adder-collator or undying-collator). - // TODO: must be the same as in relaychain ? + // TODO: must be the same as in relay chain? pub fn with_chain<T>(self, chain: T) -> Self where T: TryInto<Chain>, @@ -250,7 +250,7 @@ impl ParachainConfigBuilder<WithId> { ) } - /// Set the default command used for collators. Can be overrided. + /// Set the default command used for collators. Can be overridden. pub fn with_default_command<T>(self, command: T) -> Self where T: TryInto<Command>, @@ -271,7 +271,7 @@ impl ParachainConfigBuilder<WithId> { } } - /// Set the default container image used for collators. Can be overrided. + /// Set the default container image used for collators. Can be overridden. pub fn with_default_image<T>(self, image: T) -> Self where T: TryInto<Image>, @@ -292,8 +292,8 @@ impl ParachainConfigBuilder<WithId> { } } - /// Set the default resources limits used for collators. Can be overrided. - // TODO: adopt a strategy to merge this with the overrided value ? + /// Set the default resources limits used for collators. Can be overridden. + // TODO: adopt a strategy to merge this with the overridden value ? pub fn with_default_resources(self, f: fn(ResourcesBuilder) -> ResourcesBuilder) -> Self { match f(ResourcesBuilder::new()).build() { Ok(default_resources) => Self::transition( @@ -316,7 +316,7 @@ impl ParachainConfigBuilder<WithId> { } } - /// Set the default database snapshot location that will be used for state. Can be overrided. + /// Set the default database snapshot location that will be used for state. Can be overridden. pub fn with_default_db_snapshot(self, location: impl Into<AssetLocation>) -> Self { Self::transition( ParachainConfig { @@ -327,8 +327,8 @@ impl ParachainConfigBuilder<WithId> { ) } - /// Set the default args that will be used to execute the collator command. Can be overrided. - // TODO: adopt a strategy to merge this with the overrided value ? + /// Set the default arguments that will be used to execute the collator command. Can be overridden. + // TODO: adopt a strategy to merge this with the overridden value ? pub fn with_default_args(self, args: Vec<Arg>) -> Self { Self::transition( ParachainConfig { @@ -409,7 +409,7 @@ impl ParachainConfigBuilder<WithId> { } } - /// Set the location of a pre-existing chain spec for the parachain. + /// Set the location of a pre-existing chain specification for the parachain. pub fn with_chain_spec_path(self, location: impl Into<AssetLocation>) -> Self { Self::transition( ParachainConfig { @@ -420,7 +420,7 @@ impl ParachainConfigBuilder<WithId> { ) } - /// Set wether the parachain is based on cumulus (true in a majority of case, except adder or undying collators). + /// Set whether the parachain is based on cumulus (true in a majority of case, except adder or undying collators). pub fn cumulus_based(self, choice: bool) -> Self { Self::transition( ParachainConfig { @@ -513,7 +513,7 @@ impl ParachainConfigBuilder<WithAtLeastOneCollator> { } } - /// Seal the builder and returns a `ParachainConfig` if there are no validation errors, else returns errors. + /// Seals the builder and returns a `ParachainConfig` if there are no validation errors, else returns errors. pub fn build(self) -> Result<ParachainConfig, Vec<anyhow::Error>> { if !self.errors.is_empty() { return Err(self diff --git a/crates/configuration/src/relaychain.rs b/crates/configuration/src/relaychain.rs index e024cb2df6d895a670f2c1ef5be92073636c52aa..50c1ca72a718c14af6a317b06fccc68f5efc21e2 100644 --- a/crates/configuration/src/relaychain.rs +++ b/crates/configuration/src/relaychain.rs @@ -9,7 +9,7 @@ use crate::shared::{ types::{Arg, AssetLocation, Chain, ChainDefaultContext, Command, Image}, }; -/// A relaychain configuration, composed of nodes and fine-grained configuration options. +/// A relay chainconfiguration, composed of nodes and fine-grained configuration options. #[derive(Debug, Clone, PartialEq)] pub struct RelaychainConfig { /// Chain to use (e.g. rococo-local). @@ -69,17 +69,17 @@ impl RelaychainConfig { self.default_db_snapshot.as_ref() } - /// The default args that will be used to launch the node command. + /// The default arguments that will be used to launch the node command. pub fn default_args(&self) -> Vec<&Arg> { self.default_args.iter().collect::<Vec<&Arg>>() } - /// The location of an pre-existing chain spec for the relaychain. + /// The location of an pre-existing chain specification for the relay chain. pub fn chain_spec_path(&self) -> Option<&AssetLocation> { self.chain_spec_path.as_ref() } - // TODO: description? + /// The maximum number of nominations to create per nominator, as default we use `24` as is set in `kusama`. pub fn random_nominators_count(&self) -> Option<u32> { self.random_nominators_count } @@ -89,7 +89,7 @@ impl RelaychainConfig { self.max_nominations } - /// The nodes of the relaychain. + /// The nodes of the relay chain. pub fn nodes(&self) -> Vec<&NodeConfig> { self.nodes.iter().collect::<Vec<&NodeConfig>>() } @@ -101,7 +101,7 @@ states! { WithAtLeastOneNode } -/// A relaychain configuration builder, used to build a `RelaychainConfig` declaratively with fields validation. +/// A relay chain configuration builder, used to build a `RelaychainConfig` declaratively with fields validation. #[derive(Debug)] pub struct RelaychainConfigBuilder<State> { config: RelaychainConfig, @@ -183,7 +183,7 @@ impl RelaychainConfigBuilder<Initial> { } impl RelaychainConfigBuilder<WithChain> { - /// Set the default command used for nodes. Can be overrided. + /// Set the default command used for nodes. Can be overridden. pub fn with_default_command<T>(self, command: T) -> Self where T: TryInto<Command>, @@ -204,7 +204,7 @@ impl RelaychainConfigBuilder<WithChain> { } } - /// Set the default container image used for nodes. Can be overrided. + /// Set the default container image used for nodes. Can be overridden. pub fn with_default_image<T>(self, image: T) -> Self where T: TryInto<Image>, @@ -225,8 +225,8 @@ impl RelaychainConfigBuilder<WithChain> { } } - /// Set the default resources limits used for nodes. Can be overrided. - // TODO: adopt a strategy to merge this with the overrided value ? + /// Set the default resources limits used for nodes. Can be overridden. + // TODO: adopt a strategy to merge this with the overridden value ? pub fn with_default_resources(self, f: fn(ResourcesBuilder) -> ResourcesBuilder) -> Self { match f(ResourcesBuilder::new()).build() { Ok(default_resources) => Self::transition( @@ -249,7 +249,7 @@ impl RelaychainConfigBuilder<WithChain> { } } - /// Set the default database snapshot location that will be used for state. Can be overrided. + /// Set the default database snapshot location that will be used for state. Can be overridden. pub fn with_default_db_snapshot(self, location: impl Into<AssetLocation>) -> Self { Self::transition( RelaychainConfig { @@ -260,8 +260,8 @@ impl RelaychainConfigBuilder<WithChain> { ) } - /// Set the default args that will be used to execute the node command. Can be overrided. - // TODO: adopt a strategy to merge this with the overrided value ? + /// Set the default arguments that will be used to execute the node command. Can be overridden. + // TODO: adopt a strategy to merge this with the overridden value ? pub fn with_default_args(self, args: Vec<Arg>) -> Self { Self::transition( RelaychainConfig { @@ -272,7 +272,7 @@ impl RelaychainConfigBuilder<WithChain> { ) } - /// Set the location of a pre-existing chain spec for the relaychain. + /// Set the location of a pre-existing chain specification for the relay chain. pub fn with_chain_spec_path(self, location: impl Into<AssetLocation>) -> Self { Self::transition( RelaychainConfig { @@ -359,7 +359,7 @@ impl RelaychainConfigBuilder<WithAtLeastOneNode> { } } - /// Seal the builder and returns a `RelaychainConfig` if there are no validation errors, else returns errors. + /// Seals the builder and returns a `RelaychainConfig` if there are no validation errors, else returns errors. pub fn build(self) -> Result<RelaychainConfig, Vec<anyhow::Error>> { if !self.errors.is_empty() { return Err(self diff --git a/crates/configuration/src/shared/node.rs b/crates/configuration/src/shared/node.rs index 4852c1e8443528a507c91e67b1df9d4f6bb88b5b..d43ac8735936e8e797237ed3f194380817c264bb 100644 --- a/crates/configuration/src/shared/node.rs +++ b/crates/configuration/src/shared/node.rs @@ -96,7 +96,7 @@ impl NodeConfig { self.args.iter().collect() } - /// Wether the node is a validator. + /// Whether the node is a validator. pub fn is_validator(&self) -> bool { self.is_validator } @@ -290,7 +290,7 @@ impl NodeConfigBuilder<Buildable> { } } - /// Set the args that will be used when launching the node. + /// Set the arguments that will be used when launching the node. pub fn with_args(self, args: Vec<Arg>) -> Self { Self::transition( NodeConfig { @@ -301,7 +301,7 @@ impl NodeConfigBuilder<Buildable> { ) } - /// Set wether the node is a validator. + /// Set whether the node is a validator. pub fn validator(self, choice: bool) -> Self { Self::transition( NodeConfig { @@ -312,7 +312,7 @@ impl NodeConfigBuilder<Buildable> { ) } - /// Set wether the node is invulnerable. + /// Set whether the node is invulnerable. pub fn invulnerable(self, choice: bool) -> Self { Self::transition( NodeConfig { @@ -323,7 +323,7 @@ impl NodeConfigBuilder<Buildable> { ) } - /// Set wether the node is a bootnode. + /// Set whether the node is a bootnode. pub fn bootnode(self, choice: bool) -> Self { Self::transition( NodeConfig { @@ -469,7 +469,7 @@ impl NodeConfigBuilder<Buildable> { ) } - /// Seal the builder and returns a `NodeConfig` if there are no validation errors, else returns errors. + /// Seals the builder and returns a `NodeConfig` if there are no validation errors, else returns errors. pub fn build(self) -> Result<NodeConfig, (String, Vec<anyhow::Error>)> { if !self.errors.is_empty() { return Err((self.config.name.clone(), self.errors)); diff --git a/crates/configuration/src/shared/resources.rs b/crates/configuration/src/shared/resources.rs index a5e9a378a74e7bd9c5476ca327e6d93ed732bb6f..5456a342dfff0853c3acc0db856831fba7a5c56c 100644 --- a/crates/configuration/src/shared/resources.rs +++ b/crates/configuration/src/shared/resources.rs @@ -108,7 +108,7 @@ impl ResourcesBuilder { Self { config, errors } } - /// Set the memory limit for requests. + /// Set the requested memory for a pod. This is the minimum memory allocated for a pod. pub fn with_request_memory<T>(self, quantity: T) -> Self where T: TryInto<ResourceQuantity>, @@ -129,7 +129,7 @@ impl ResourcesBuilder { } } - /// Set the CPU limit for requests. + /// Set the requested CPU limit for a pod. This is the minimum CPU allocated for a pod. pub fn with_request_cpu<T>(self, quantity: T) -> Self where T: TryInto<ResourceQuantity>, @@ -150,7 +150,7 @@ impl ResourcesBuilder { } } - /// Set the overall memory limit. + /// Set the overall memory limit for a pod. This is the maximum memory threshold for a pod. pub fn with_limit_memory<T>(self, quantity: T) -> Self where T: TryInto<ResourceQuantity>, @@ -171,7 +171,7 @@ impl ResourcesBuilder { } } - /// Set the overall CPU limit. + /// Set the overall CPU limit for a pod. This is the maximum CPU threshold for a pod. pub fn with_limit_cpu<T>(self, quantity: T) -> Self where T: TryInto<ResourceQuantity>, @@ -192,7 +192,7 @@ impl ResourcesBuilder { } } - /// Seal the builder and returns a `Resources` if there are no validation errors, else returns errors. + /// Seals the builder and returns a `Resources` if there are no validation errors, else returns errors. pub fn build(self) -> Result<Resources, Vec<anyhow::Error>> { if !self.errors.is_empty() { return Err(self.errors);