mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 06:21:11 +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:
@@ -13,6 +13,7 @@ application-crypto = { package = "sp-application-crypto", git = "https://github.
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
runtime_primitives = { package = "sp-runtime", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
polkadot-parachain = { path = "../parachain", default-features = false }
|
||||
trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -33,6 +34,7 @@ std = [
|
||||
"sp-api/std",
|
||||
"sp-std/std",
|
||||
"sp-version/std",
|
||||
"sp-staking/std",
|
||||
"runtime_primitives/std",
|
||||
"serde",
|
||||
"polkadot-parachain/std",
|
||||
|
||||
@@ -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