mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
Avoid Panic When Fetching Info Before Bridge is Initialized (#504)
* Allow bridge pallet to return no finalized headers * Update Runtime APIs to optionally return best finalized header * Update relay to handle optional best finalized headers * Fix Clippy lints * Return a dummy header instead of an Option * Remove Option from runtime Apis * Remove support for handling optional finalized headers in relay
This commit is contained in:
committed by
Bastian Köcher
parent
595523106e
commit
e91cab68d4
@@ -34,6 +34,8 @@ pub enum Error {
|
||||
Request(RequestError),
|
||||
/// The response from the server could not be SCALE decoded.
|
||||
ResponseParseFailed(codec::Error),
|
||||
/// The Substrate bridge pallet has not yet been initialized.
|
||||
UninitializedBridgePallet,
|
||||
/// Account does not exist on the chain.
|
||||
AccountDoesNotExist,
|
||||
/// Custom logic error.
|
||||
@@ -70,6 +72,7 @@ impl ToString for Error {
|
||||
Self::WsConnectionError(e) => e.to_string(),
|
||||
Self::Request(e) => e.to_string(),
|
||||
Self::ResponseParseFailed(e) => e.what().to_string(),
|
||||
Self::UninitializedBridgePallet => "The Substrate bridge pallet has not been initialized yet.".into(),
|
||||
Self::AccountDoesNotExist => "Account does not exist on the chain".into(),
|
||||
Self::Custom(e) => e.clone(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user