mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
Implement the Runtime API subsystem (#1494)
* type defaults for ParachainHost * add ValidationCode message * implement core loop of runtime API subsystem * subsystem trait implementation for runtime API subsystem * implement a mock runtime API * some tests that ensure requests are forwarded to runtime API correctly * fix dependency grumbles * improve RuntimeApiError API
This commit is contained in:
committed by
GitHub
parent
80303e99ea
commit
652ae86afd
@@ -300,6 +300,12 @@ pub struct SchedulerRoster {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct RuntimeApiError(String);
|
||||
|
||||
impl From<String> for RuntimeApiError {
|
||||
fn from(s: String) -> Self {
|
||||
RuntimeApiError(s)
|
||||
}
|
||||
}
|
||||
|
||||
/// A sender for the result of a runtime API request.
|
||||
pub type RuntimeApiSender<T> = oneshot::Sender<Result<T, RuntimeApiError>>;
|
||||
|
||||
@@ -324,6 +330,10 @@ pub enum RuntimeApiRequest {
|
||||
),
|
||||
/// Get the session index that a child of the block will have.
|
||||
SessionIndexForChild(RuntimeApiSender<SessionIndex>),
|
||||
/// Get the validation code for a para, taking the given `OccupiedCoreAssumption`, which
|
||||
/// will inform on how the validation data should be computed if the para currently
|
||||
/// occupies a core.
|
||||
ValidationCode(ParaId, OccupiedCoreAssumption, RuntimeApiSender<Option<ValidationCode>>),
|
||||
/// Get a the candidate pending availability for a particular parachain by parachain / core index
|
||||
CandidatePendingAvailability(ParaId, RuntimeApiSender<Option<CommittedCandidateReceipt>>),
|
||||
/// Get all events concerning candidates (backing, inclusion, time-out) in the parent of
|
||||
|
||||
Reference in New Issue
Block a user