mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 07:48:00 +00:00
Runtime API: introduce candidates_pending_availability (#4027)
Fixes https://github.com/paritytech/polkadot-sdk/issues/3576 Required by elastic scaling collators. Deprecates old API: `candidate_pending_availability`. TODO: - [x] PRDoc --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
@@ -47,6 +47,7 @@ struct MockSubsystemClient {
|
||||
validation_outputs_results: HashMap<ParaId, bool>,
|
||||
session_index_for_child: SessionIndex,
|
||||
candidate_pending_availability: HashMap<ParaId, CommittedCandidateReceipt>,
|
||||
candidates_pending_availability: HashMap<ParaId, Vec<CommittedCandidateReceipt>>,
|
||||
dmq_contents: HashMap<ParaId, Vec<InboundDownwardMessage>>,
|
||||
hrmp_channels: HashMap<ParaId, BTreeMap<ParaId, Vec<InboundHrmpMessage>>>,
|
||||
validation_code_by_hash: HashMap<ValidationCodeHash, ValidationCode>,
|
||||
@@ -140,6 +141,14 @@ impl RuntimeApiSubsystemClient for MockSubsystemClient {
|
||||
Ok(self.candidate_pending_availability.get(¶_id).cloned())
|
||||
}
|
||||
|
||||
async fn candidates_pending_availability(
|
||||
&self,
|
||||
_: Hash,
|
||||
para_id: ParaId,
|
||||
) -> Result<Vec<CommittedCandidateReceipt<Hash>>, ApiError> {
|
||||
Ok(self.candidates_pending_availability.get(¶_id).cloned().unwrap_or_default())
|
||||
}
|
||||
|
||||
async fn candidate_events(&self, _: Hash) -> Result<Vec<CandidateEvent<Hash>>, ApiError> {
|
||||
Ok(self.candidate_events.clone())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user