Skip to content
Snippets Groups Projects
Commit e6e5d1bb authored by yjh's avatar yjh Committed by GitHub
Browse files

Fix some typos for client (#968)

* chore: fix typos for consensus

* chore: fix typos for RelayChainError
parent f52b5495
No related merge requests found
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>. // along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! The AuRa consensus algoritm for parachains. //! The AuRa consensus algorithm for parachains.
//! //!
//! This extends the Substrate provided AuRa consensus implementation to make it compatible for //! This extends the Substrate provided AuRa consensus implementation to make it compatible for
//! parachains. The main entry points for of this consensus algorithm are [`build_aura_consensus`] //! parachains. The main entry points for of this consensus algorithm are [`AuraConsensus::build`]
//! and [`import_queue`]. //! and [`import_queue`].
//! //!
//! For more information about AuRa, the Substrate crate should be checked. //! For more information about AuRa, the Substrate crate should be checked.
...@@ -216,7 +216,7 @@ where ...@@ -216,7 +216,7 @@ where
} }
} }
/// Paramaters of [`build_aura_consensus`]. /// Parameters of [`AuraConsensus:build`].
pub struct BuildAuraConsensusParams<PF, BI, CIDP, Client, BS, SO> { pub struct BuildAuraConsensusParams<PF, BI, CIDP, Client, BS, SO> {
pub proposer_factory: PF, pub proposer_factory: PF,
pub create_inherent_data_providers: CIDP, pub create_inherent_data_providers: CIDP,
......
...@@ -104,7 +104,7 @@ where ...@@ -104,7 +104,7 @@ where
mut block_import_params: sc_consensus::BlockImportParams<Block, Self::Transaction>, mut block_import_params: sc_consensus::BlockImportParams<Block, Self::Transaction>,
cache: std::collections::HashMap<sp_consensus::CacheKeyId, Vec<u8>>, cache: std::collections::HashMap<sp_consensus::CacheKeyId, Vec<u8>>,
) -> Result<sc_consensus::ImportResult, Self::Error> { ) -> Result<sc_consensus::ImportResult, Self::Error> {
// Best block is determined by the relay chain, or if we are doing the intial sync // Best block is determined by the relay chain, or if we are doing the initial sync
// we import all blocks as new best. // we import all blocks as new best.
block_import_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom( block_import_params.fork_choice = Some(sc_consensus::ForkChoiceStrategy::Custom(
block_import_params.origin == sp_consensus::BlockOrigin::NetworkInitialSync, block_import_params.origin == sp_consensus::BlockOrigin::NetworkInitialSync,
......
...@@ -123,7 +123,7 @@ where ...@@ -123,7 +123,7 @@ where
/// Run the parachain consensus. /// Run the parachain consensus.
/// ///
/// This will follow the given `relay_chain` to act as consesus for the parachain that corresponds /// This will follow the given `relay_chain` to act as consensus for the parachain that corresponds
/// to the given `para_id`. It will set the new best block of the parachain as it gets aware of it. /// to the given `para_id`. It will set the new best block of the parachain as it gets aware of it.
/// The same happens for the finalized block. /// The same happens for the finalized block.
/// ///
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>. // along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! The relay-chain provided consensus algoritm for parachains. //! The relay-chain provided consensus algorithm for parachains.
//! //!
//! This is the simplest consensus algorithm you can use when developing a parachain. It is a //! This is the simplest consensus algorithm you can use when developing a parachain. It is a
//! permission-less consensus algorithm that doesn't require any staking or similar to join as a //! permission-less consensus algorithm that doesn't require any staking or similar to join as a
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
//! 3. The parachain validators validate at most X different parachain candidates, where X is the //! 3. The parachain validators validate at most X different parachain candidates, where X is the
//! total number of parachain validators. //! total number of parachain validators.
//! //!
//! 4. The parachain candidate that is backed by the most validators is choosen by the relay-chain //! 4. The parachain candidate that is backed by the most validators is chosen by the relay-chain
//! block producer to be added as backed candidate on chain. //! block producer to be added as backed candidate on chain.
//! //!
//! 5. After the parachain candidate got backed and included, all collators start at 1. //! 5. After the parachain candidate got backed and included, all collators start at 1.
...@@ -217,7 +217,7 @@ where ...@@ -217,7 +217,7 @@ where
} }
} }
/// Paramaters of [`build_relay_chain_consensus`]. /// Parameters of [`build_relay_chain_consensus`].
pub struct BuildRelayChainConsensusParams<PF, BI, CIDP, RCInterface> { pub struct BuildRelayChainConsensusParams<PF, BI, CIDP, RCInterface> {
pub para_id: ParaId, pub para_id: ParaId,
pub proposer_factory: PF, pub proposer_factory: PF,
......
...@@ -36,7 +36,7 @@ pub type RelayChainResult<T> = Result<T, RelayChainError>; ...@@ -36,7 +36,7 @@ pub type RelayChainResult<T> = Result<T, RelayChainError>;
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
pub enum RelayChainError { pub enum RelayChainError {
#[error("Error occured while calling relay chain runtime: {0:?}")] #[error("Error occurred while calling relay chain runtime: {0:?}")]
ApiError(#[from] ApiError), ApiError(#[from] ApiError),
#[error("Timeout while waiting for relay-chain block `{0}` to be imported.")] #[error("Timeout while waiting for relay-chain block `{0}` to be imported.")]
WaitTimeout(PHash), WaitTimeout(PHash),
...@@ -46,9 +46,9 @@ pub enum RelayChainError { ...@@ -46,9 +46,9 @@ pub enum RelayChainError {
WaitBlockchainError(PHash, sp_blockchain::Error), WaitBlockchainError(PHash, sp_blockchain::Error),
#[error("Blockchain returned an error: {0:?}")] #[error("Blockchain returned an error: {0:?}")]
BlockchainError(#[from] sp_blockchain::Error), BlockchainError(#[from] sp_blockchain::Error),
#[error("State machine error occured: {0:?}")] #[error("State machine error occurred: {0:?}")]
StateMachineError(Box<dyn sp_state_machine::Error>), StateMachineError(Box<dyn sp_state_machine::Error>),
#[error("Unspecified error occured: {0:?}")] #[error("Unspecified error occurred: {0:?}")]
GenericError(String), GenericError(String),
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//! Auxillary struct/enums for parachain runtimes. //! Auxiliary struct/enums for parachain runtimes.
//! Taken from polkadot/runtime/common (at a21cd64) and adapted for parachains. //! Taken from polkadot/runtime/common (at a21cd64) and adapted for parachains.
use frame_support::traits::{ use frame_support::traits::{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment