mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Networking and in-memory client (#38)
* Networking crate draft * Started work on syncing algo * Fixed query range * BlockCollection tests * In-mem client backend * Fixed tests * Renamed Transaction * Removed stray println * Docs
This commit is contained in:
committed by
Robert Habermeier
parent
8e554129ec
commit
44499550d9
@@ -16,8 +16,9 @@
|
||||
|
||||
//! Polkadot client possible errors.
|
||||
|
||||
use primitives::block;
|
||||
use std;
|
||||
use state_machine;
|
||||
use blockchain;
|
||||
|
||||
error_chain! {
|
||||
errors {
|
||||
@@ -28,7 +29,7 @@ error_chain! {
|
||||
}
|
||||
|
||||
/// Unknown block.
|
||||
UnknownBlock(h: block::HeaderHash) {
|
||||
UnknownBlock(h: blockchain::BlockId) {
|
||||
description("unknown block"),
|
||||
display("UnknownBlock: {}", h),
|
||||
}
|
||||
@@ -38,6 +39,12 @@ error_chain! {
|
||||
description("execution error"),
|
||||
display("Execution: {}", e),
|
||||
}
|
||||
|
||||
/// Blockchain error.
|
||||
Blockchain(e: Box<std::error::Error + Send>) {
|
||||
description("Blockchain error"),
|
||||
display("Blockchain: {}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,3 +54,16 @@ impl From<Box<state_machine::Error>> for Error {
|
||||
ErrorKind::Execution(e).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<state_machine::backend::Void> for Error {
|
||||
fn from(_e: state_machine::backend::Void) -> Self {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
impl Error {
|
||||
/// Chain a blockchain error.
|
||||
pub fn from_blockchain(e: Box<std::error::Error + Send>) -> Self {
|
||||
ErrorKind::Blockchain(e).into()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user