remove legacy release_delay and add block_distance for maximum block range for the eth_getLogs

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch
2025-06-18 18:53:19 +03:00
parent 39a6192d28
commit 671196ebac
5 changed files with 227 additions and 196 deletions

View File

@@ -31,7 +31,7 @@ fn prepare_network<T: Config>(
gatekeeper,
topic_name,
finality_delay: Some(69),
release_delay: Some(69),
block_distance: 69,
network_type: NetworkType::Evm,
incoming_fee: 0,
outgoing_fee: 0,
@@ -120,16 +120,16 @@ benchmarks! {
assert_ne!(GhostNetworks::<T>::networks(chain_id.clone()), prev_network);
}
update_network_release_delay {
let delay = Some(1337);
update_network_block_distance {
let block_distance = 1337;
let (chain_id, network) = prepare_network::<T>(1, 1);
let authority = T::UpdateOrigin::try_successful_origin()
.map_err(|_| BenchmarkError::Weightless)?;
let prev_network = create_network::<T>(chain_id.clone(), network.clone())?;
}: _<T::RuntimeOrigin>(authority, chain_id.clone(), delay)
}: _<T::RuntimeOrigin>(authority, chain_id.clone(), block_distance)
verify {
assert_last_event::<T>(Event::NetworkReleaseDelayUpdated {
chain_id: chain_id.clone(), release_delay: delay,
assert_last_event::<T>(Event::NetworkBlockDistanceUpdated {
chain_id: chain_id.clone(), block_distance,
}.into());
assert_ne!(GhostNetworks::<T>::networks(chain_id.clone()), prev_network);
}