mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Remove footgun around session keys/handlers (#3949)
* Remove footgun around session keys/handlers - `OpaqueKeys` now has an associated type `KeyTypeIdProviders`. This can be used in the runtime as input for `SessionHandler` from the session trait. - `impl_opaque_keys` now works with modules and extracts the `KeyTypeId` from the module directly. - Added some checks to the `session` storage initialization that checks that the `SessionHandler` and `Keys` use the same number of keys and that the order is equal. * Update core/sr-primitives/src/traits.rs
This commit is contained in:
@@ -25,15 +25,7 @@ pub mod system;
|
||||
use rstd::{prelude::*, marker::PhantomData};
|
||||
use codec::{Encode, Decode, Input, Error};
|
||||
|
||||
use primitives::{
|
||||
Blake2Hasher,
|
||||
OpaqueMetadata,
|
||||
RuntimeDebug,
|
||||
testing::{
|
||||
ED25519,
|
||||
SR25519,
|
||||
}
|
||||
};
|
||||
use primitives::{Blake2Hasher, OpaqueMetadata, RuntimeDebug};
|
||||
use app_crypto::{ed25519, sr25519, RuntimeAppPublic};
|
||||
pub use app_crypto;
|
||||
use trie_db::{TrieMut, Trie};
|
||||
@@ -454,9 +446,7 @@ fn code_using_trie() -> u64 {
|
||||
|
||||
impl_opaque_keys! {
|
||||
pub struct SessionKeys {
|
||||
#[id(ED25519)]
|
||||
pub ed25519: ed25519::AppPublic,
|
||||
#[id(SR25519)]
|
||||
pub sr25519: sr25519::AppPublic,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user