mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +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:
@@ -253,7 +253,7 @@ mod tests {
|
||||
use crate::{crypto, known_payloads, KEY_TYPE};
|
||||
use codec::Decode;
|
||||
use sp_core::{keccak_256, Pair};
|
||||
use sp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};
|
||||
use sp_keystore::{testing::MemoryKeystore, KeystorePtr};
|
||||
|
||||
type TestCommitment = Commitment<u128>;
|
||||
type TestSignedCommitment = SignedCommitment<u128, crypto::Signature>;
|
||||
@@ -266,17 +266,13 @@ mod tests {
|
||||
let store: KeystorePtr = MemoryKeystore::new().into();
|
||||
|
||||
let alice = sp_core::ecdsa::Pair::from_string("//Alice", None).unwrap();
|
||||
let _ = Keystore::insert(&*store, KEY_TYPE, "//Alice", alice.public().as_ref()).unwrap();
|
||||
store.insert(KEY_TYPE, "//Alice", alice.public().as_ref()).unwrap();
|
||||
|
||||
let msg = keccak_256(b"This is the first message");
|
||||
let sig1 = Keystore::ecdsa_sign_prehashed(&*store, KEY_TYPE, &alice.public(), &msg)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
let sig1 = store.ecdsa_sign_prehashed(KEY_TYPE, &alice.public(), &msg).unwrap().unwrap();
|
||||
|
||||
let msg = keccak_256(b"This is the second message");
|
||||
let sig2 = Keystore::ecdsa_sign_prehashed(&*store, KEY_TYPE, &alice.public(), &msg)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
let sig2 = store.ecdsa_sign_prehashed(KEY_TYPE, &alice.public(), &msg).unwrap().unwrap();
|
||||
|
||||
(sig1.into(), sig2.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user