1use crate::error::{LocalStorageError, RemoteStorageError, RpcClientError};
4use subxt::config::substrate::H256;
5use thiserror::Error;
6
7#[derive(Debug, Error)]
9pub enum BlockError {
10 #[error("RPC error: {0}")]
12 Rpc(#[from] RpcClientError),
13
14 #[error("Storage error: {0}")]
16 Storage(#[from] LocalStorageError),
17
18 #[error("Remote storage error: {0}")]
20 RemoteStorage(#[from] RemoteStorageError),
21
22 #[error("Block not found: {0:?}")]
24 BlockHashNotFound(H256),
25
26 #[error("Block not found: {0:?}")]
28 BlockNumberNotFound(u32),
29
30 #[error("Runtime code not found in storage")]
32 RuntimeCodeNotFound,
33
34 #[error("Concurrent block build detected: parent block changed during building")]
36 ConcurrentBlockBuild,
37}