mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 20:01:08 +00:00
pvf-precheck: teach runtime-api to work with versions (#4510)
As part of #3211 we will need to add a couple of runtime APIs. That change is coming in a following PR. The runtime API for pre-checking will be introduced with a version bump for `ParachainHost`. This commit prepares the ground for that change, by introducing a error condition that signals that the given API is not supported.
This commit is contained in:
@@ -240,7 +240,18 @@ fn runtime_api_error_does_not_stop_the_subsystem() {
|
||||
RuntimeApiRequest::CandidateEvents(tx),
|
||||
)) => {
|
||||
assert_eq!(relay_parent, new_leaf);
|
||||
tx.send(Err(RuntimeApiError::from("oh no".to_string()))).unwrap();
|
||||
#[derive(Debug)]
|
||||
struct FauxError;
|
||||
impl std::error::Error for FauxError {}
|
||||
impl std::fmt::Display for FauxError {
|
||||
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
tx.send(Err(RuntimeApiError::Execution {
|
||||
runtime_api_name: "faux",
|
||||
source: Arc::new(FauxError),
|
||||
})).unwrap();
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user