mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 12:11:02 +00:00
Keystore overhaul (iter 2) (#13634)
* Remove bloat about remote keystore * Update docs and remove unused 'KeystoreRef' trait * Use wherever possible, MemoryKeystore for testing * Remove unrequired fully qualified method syntax for Keystore
This commit is contained in:
@@ -28,7 +28,7 @@ use serde::Serialize;
|
||||
use codec::{Codec, Decode, Encode, Input};
|
||||
use scale_info::TypeInfo;
|
||||
#[cfg(feature = "std")]
|
||||
use sp_keystore::{Keystore, KeystorePtr};
|
||||
use sp_keystore::KeystorePtr;
|
||||
use sp_runtime::{
|
||||
traits::{Header as HeaderT, NumberFor},
|
||||
ConsensusEngineId, RuntimeDebug,
|
||||
@@ -455,16 +455,12 @@ where
|
||||
use sp_core::crypto::Public;
|
||||
|
||||
let encoded = localized_payload(round, set_id, &message);
|
||||
let signature = Keystore::sign_with(
|
||||
&*keystore,
|
||||
AuthorityId::ID,
|
||||
&public.to_public_crypto_pair(),
|
||||
&encoded[..],
|
||||
)
|
||||
.ok()
|
||||
.flatten()?
|
||||
.try_into()
|
||||
.ok()?;
|
||||
let signature = keystore
|
||||
.sign_with(AuthorityId::ID, &public.to_public_crypto_pair(), &encoded[..])
|
||||
.ok()
|
||||
.flatten()?
|
||||
.try_into()
|
||||
.ok()?;
|
||||
|
||||
Some(grandpa::SignedMessage { message, signature, id: public })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user