avoid clone during local keys extraction

Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
Uncle Stinky 2026-10-31 16:45:14 +03:00
parent c25c3edd30
commit 52a1aa0fab
Signed by: st1nky
GPG Key ID: 016064BD97603B40
3 changed files with 4 additions and 9 deletions

2
Cargo.lock generated
View File

@ -4114,7 +4114,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-weaver" name = "ghost-weaver"
version = "0.0.23" version = "0.0.24"
dependencies = [ dependencies = [
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "ghost-weaver" name = "ghost-weaver"
version = "0.0.23" version = "0.0.24"
description = "Weaving a secure cryptographic tapestry across different external chains." description = "Weaving a secure cryptographic tapestry across different external chains."
license.workspace = true license.workspace = true
authors.workspace = true authors.workspace = true

View File

@ -742,7 +742,7 @@ impl<T: Config> Pallet<T> {
let lock_period_key = Self::create_storage_key(b"network-period", &network_id_encoded); let lock_period_key = Self::create_storage_key(b"network-period", &network_id_encoded);
let lock_period = Self::read_offchain_storage(&lock_period_key, &MIN_LOCK_GUARD_PERIOD); let lock_period = Self::read_offchain_storage(&lock_period_key, &MIN_LOCK_GUARD_PERIOD);
let lock_until = rt_offchain::Duration::from_millis(lock_period); let lock_until = rt_offchain::Duration::from_millis(lock_period.max(MIN_LOCK_GUARD_PERIOD));
let network_lock_key = Self::create_storage_key(b"network-lock-", &network_id_encoded); let network_lock_key = Self::create_storage_key(b"network-lock-", &network_id_encoded);
let mut network_lock = StorageLock::<Time>::with_deadline(&network_lock_key, lock_until); let mut network_lock = StorageLock::<Time>::with_deadline(&network_lock_key, lock_until);
@ -1114,12 +1114,7 @@ impl<T: Config> Pallet<T> {
local_authorities local_authorities
.binary_search(&authority) .binary_search(&authority)
.ok() .ok()
.map(|location| { .map(|_| (index as AuthIndex, authority))
(
index.unique_saturated_into(),
local_authorities[location].clone(),
)
})
}) })
} }