mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Remove Parent Hash to Session mapping (#928)
* Adds a SigningContext type * Bump spec versions * Fixes requested changes * Bump ParachainHost api_version and guard signing_context call * Improve error message * If there is no signing_context api use default value Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -608,6 +608,15 @@ pub enum ValidityAttestation {
|
||||
Explicit(ValidatorSignature),
|
||||
}
|
||||
|
||||
/// A type returned by runtime with current session index and a parent hash.
|
||||
#[derive(Clone, Eq, PartialEq, Default, Decode, Encode, RuntimeDebug)]
|
||||
pub struct SigningContext {
|
||||
/// Current session index.
|
||||
pub session_index: sp_staking::SessionIndex,
|
||||
/// Hash of the parent.
|
||||
pub parent_hash: Hash,
|
||||
}
|
||||
|
||||
/// An attested candidate. This is submitted to the relay chain by a block author.
|
||||
#[derive(Clone, PartialEq, Decode, Encode, RuntimeDebug)]
|
||||
pub struct AttestedCandidate {
|
||||
@@ -655,7 +664,7 @@ impl FeeSchedule {
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
/// The API for querying the state of parachains on-chain.
|
||||
#[api_version(2)]
|
||||
#[api_version(3)]
|
||||
pub trait ParachainHost {
|
||||
/// Get the current validators.
|
||||
fn validators() -> Vec<ValidatorId>;
|
||||
@@ -673,6 +682,8 @@ sp_api::decl_runtime_apis! {
|
||||
/// Extract the abridged head that was set in the extrinsics.
|
||||
fn get_heads(extrinsics: Vec<<Block as BlockT>::Extrinsic>)
|
||||
-> Option<Vec<AbridgedCandidateReceipt>>;
|
||||
/// Get a `SigningContext` with current `SessionIndex` and parent hash.
|
||||
fn signing_context() -> SigningContext;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user