mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
ECDSA Support in signer (#1064)
* Add ecdsa support to signer * Remove nix. Cleanup. * remove ecdsa example and small tidy * fmt * fix wasm test * feature flag ecdsa/sr25519 support, use global signing context * clippy fix * ensure signers all impl Signer trait in doc test * fix CI * fix digner test * remove dead code warnings when no features enabled * move dead code attr to right place * fix random clippy error that popped up --------- Co-authored-by: Lech Głowiak <lech.glowiak@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#![cfg(target_arch = "wasm32")]
|
||||
|
||||
use subxt_signer::sr25519;
|
||||
use subxt_signer::{ ecdsa, sr25519 };
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||
@@ -16,7 +16,7 @@ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||
// (subxt seems to, for instance).
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
async fn wasm_signing_works() {
|
||||
async fn wasm_sr25519_signing_works() {
|
||||
let alice = sr25519::dev::alice();
|
||||
|
||||
// There's some non-determinism in the signing, so this ensures that
|
||||
@@ -24,3 +24,13 @@ async fn wasm_signing_works() {
|
||||
let signature = alice.sign(b"Hello there");
|
||||
assert!(sr25519::verify(&signature, b"Hello there", &alice.public_key()));
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
async fn wasm_ecdsa_signing_works() {
|
||||
let alice = ecdsa::dev::alice();
|
||||
|
||||
// There's some non-determinism in the signing, so this ensures that
|
||||
// the rand stuff is configured properly to run ok in wasm.
|
||||
let signature = alice.sign(b"Hello there");
|
||||
assert!(ecdsa::verify(&signature, b"Hello there", &alice.public_key()));
|
||||
}
|
||||
Reference in New Issue
Block a user