From 6279f7a6abbe6d4ade6c17a8a81a21d48c49e9a9 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas Date: Thu, 11 Apr 2024 15:21:39 +0100 Subject: [PATCH] fix runtime-benchmarks test --- Cargo.toml | 2 +- src/benchmarks.rs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 155c2da..c2f0e9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ version = '0.6.0' description = "Reward citizens who participated in a crowdloan to acquire a parachain slot o nthe backing relay chain." [dependencies] -ed25519-dalek = { version = "2.1", default-features = false, optional = true } +ed25519-dalek = { version = "2.1", default-features = false, features = ["alloc"], optional = true } log = { version = "0.4.20", default-features = false } parity-scale-codec = { version = "3.6.5", default-features = false} scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } diff --git a/src/benchmarks.rs b/src/benchmarks.rs index 481e44a..14c914f 100644 --- a/src/benchmarks.rs +++ b/src/benchmarks.rs @@ -103,10 +103,9 @@ fn create_sig(seed: u32, payload: Vec) -> (AccountId32, MultiSign seed_32[j] = seed_as_slice[j] } - let secret = ed25519_dalek::SecretKey::from_bytes(&seed_32).unwrap(); - let public = ed25519_dalek::PublicKey::from(&secret); - let pair = ed25519_dalek::Keypair { secret, public }; - let sig = pair.sign(&payload).to_bytes(); + let signing_key = ed25519_dalek::SigningKey::from_bytes(&seed_32); + let public = signing_key.verifying_key(); + let sig = signing_key.sign(&payload).to_bytes(); let signature: MultiSignature = ed25519::Signature::from_raw(sig).into(); let ed_public: ed25519::Public = ed25519::Public::unchecked_from(public.to_bytes());