mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 04:45:42 +00:00
Adds a session getter to historical proofs (#5125)
* Adds a session getter to historical proofs * Bump spec_version * Adds some useful trait derives to Proof
This commit is contained in:
@@ -82,7 +82,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
// and set impl_version to 0. If only runtime
|
// and set impl_version to 0. If only runtime
|
||||||
// implementation changes and behavior does not, then leave spec_version as
|
// implementation changes and behavior does not, then leave spec_version as
|
||||||
// is and increment impl_version.
|
// is and increment impl_version.
|
||||||
spec_version: 229,
|
spec_version: 230,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
use codec::{Encode, Decode};
|
use codec::{Encode, Decode};
|
||||||
use sp_runtime::KeyTypeId;
|
use sp_runtime::{KeyTypeId, RuntimeDebug};
|
||||||
use sp_runtime::traits::{Convert, OpaqueKeys};
|
use sp_runtime::traits::{Convert, OpaqueKeys};
|
||||||
use frame_support::{decl_module, decl_storage};
|
use frame_support::{decl_module, decl_storage};
|
||||||
use frame_support::{Parameter, print};
|
use frame_support::{Parameter, print};
|
||||||
@@ -258,12 +258,19 @@ impl<T: Trait> ProvingTrie<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Proof of ownership of a specific key.
|
/// Proof of ownership of a specific key.
|
||||||
#[derive(Encode, Decode, Clone)]
|
#[derive(Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug)]
|
||||||
pub struct Proof {
|
pub struct Proof {
|
||||||
session: SessionIndex,
|
session: SessionIndex,
|
||||||
trie_nodes: Vec<Vec<u8>>,
|
trie_nodes: Vec<Vec<u8>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Proof {
|
||||||
|
/// Returns a session this proof was generated for.
|
||||||
|
pub fn session(&self) -> SessionIndex {
|
||||||
|
self.session
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: Trait, D: AsRef<[u8]>> frame_support::traits::KeyOwnerProofSystem<(KeyTypeId, D)>
|
impl<T: Trait, D: AsRef<[u8]>> frame_support::traits::KeyOwnerProofSystem<(KeyTypeId, D)>
|
||||||
for Module<T>
|
for Module<T>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user