Skip to content

Commit 6ec1405

Browse files
committed
Update benchmarking.rs
1 parent 5f2f3bd commit 6ec1405

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pallets/shield/src/benchmarking.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,13 @@ mod benches {
4848
/// Benchmark `announce_next_key`.
4949
#[benchmark]
5050
fn announce_next_key() {
51-
// Generate a deterministic dev key in the host keystore (for benchmarks).
52-
// Any 4-byte KeyTypeId works for generation; it does not affect AccountId derivation.
53-
const KT: KeyTypeId = KeyTypeId(*b"benc");
54-
let alice_pub: sr25519::Public = sr25519_generate(KT, Some("//Alice".as_bytes().to_vec()));
55-
let alice_acc: AccountId32 = alice_pub.into();
56-
57-
// Make this account an Aura authority for the generic runtime.
58-
seed_aura_authority_from_sr25519::<T>(&alice_pub);
59-
6051
// Valid Kyber768 public key length per pallet check.
6152
const KYBER768_PK_LEN: usize = 1184;
6253
let public_key: BoundedVec<u8, ConstU32<2048>> = bounded_pk::<2048>(KYBER768_PK_LEN);
6354

64-
// Measure: dispatch the extrinsic.
55+
// Dispatch as UNSIGNED: the pallet expects `ensure_none(origin)?;`.
6556
#[extrinsic_call]
66-
announce_next_key(RawOrigin::Signed(alice_acc.clone()), public_key.clone());
57+
announce_next_key(RawOrigin::None, public_key.clone());
6758

6859
// Assert: NextKey should be set exactly.
6960
let stored = NextKey::<T>::get().expect("must be set by announce_next_key");

0 commit comments

Comments
 (0)