mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 16:51:02 +00:00
25aa988f9b
* Make availability-store compile for WASM * Use --manifest-path instead * Make validation work on wasm! * Switch to Spawn trait * Migrate validation to std futures * Migrate network to std futures * Final changes to validation * Tidy up network * Tidy up validation * Switch branch * Migrate service * Get polkadot to compile via wasm! * Add browser-demo * Add initial browser file * Add browser-demo * Tidy * Temp switch back to substrate/master * tidy * Fix wasm build * Re-add release flag * Switch to polkadot-master * Revert cli tokio version to avoid libp2p panic * Update tokio version * Fix availability store tests * Fix validation tests * Remove futures01 from availability-store * Fix network tests * Small changes * Fix collator * Fix typo * Revert removal of tokio_executor that causes tokio version mismatch panic * Fix adder test parachain * Revert "Revert removal of tokio_executor that causes tokio version mismatch panic" This reverts commit cfeb50c01d8df5e209483406a711e64761b44ae9. * Update availability-store/src/worker.rs Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> * Update network/src/lib.rs Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> * Update network/src/lib.rs Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com> * Box pin changes * Asyncify network functions * Clean up browser validation worker error * Fix av store test * Nits * Fix validation test * Switch favicon * Fix validation test again * Revert "Asyncify network functions" This reverts commit f20ae6548dc482cb1e75bc80641cfe55c6131a53. * Add async blocks back in
61 lines
2.1 KiB
Rust
61 lines
2.1 KiB
Rust
// Copyright 2017 Parity Technologies (UK) Ltd.
|
|
// This file is part of Polkadot.
|
|
|
|
// Polkadot is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// Polkadot is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//! Errors that can occur during the validation process.
|
|
|
|
use polkadot_primitives::parachain::ValidatorId;
|
|
|
|
/// Error type for validation
|
|
#[derive(Debug, derive_more::Display, derive_more::From)]
|
|
pub enum Error {
|
|
/// Client error
|
|
Client(sp_blockchain::Error),
|
|
/// Consensus error
|
|
Consensus(consensus::error::Error),
|
|
#[display(fmt = "Invalid duty roster length: expected {}, got {}", expected, got)]
|
|
InvalidDutyRosterLength {
|
|
/// Expected roster length
|
|
expected: usize,
|
|
/// Actual roster length
|
|
got: usize,
|
|
},
|
|
/// Local account not a validator at this block
|
|
#[display(fmt = "Local account ID ({:?}) not a validator at this block.", _0)]
|
|
NotValidator(ValidatorId),
|
|
/// Unexpected error checking inherents
|
|
#[display(fmt = "Unexpected error while checking inherents: {}", _0)]
|
|
InherentError(inherents::Error),
|
|
/// Proposer destroyed before finishing proposing or evaluating
|
|
#[display(fmt = "Proposer destroyed before finishing proposing or evaluating")]
|
|
PrematureDestruction,
|
|
/// Timer failed
|
|
#[display(fmt = "Timer failed: {}", _0)]
|
|
Timer(std::io::Error),
|
|
#[display(fmt = "Failed to compute deadline of now + {:?}", _0)]
|
|
DeadlineComputeFailure(std::time::Duration),
|
|
Join(tokio::task::JoinError)
|
|
}
|
|
|
|
impl std::error::Error for Error {
|
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
|
match self {
|
|
Error::Client(ref err) => Some(err),
|
|
Error::Consensus(ref err) => Some(err),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|