mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 11:19:57 +00:00
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:
@@ -55,8 +55,8 @@ pub struct NetworkData {
|
||||
pub gatekeeper: Vec<u8>,
|
||||
pub topic_name: Vec<u8>,
|
||||
pub finality_delay: Option<u64>,
|
||||
pub release_delay: Option<u64>,
|
||||
pub network_type: NetworkType,
|
||||
pub block_distance: u64,
|
||||
pub incoming_fee: u32,
|
||||
pub outgoing_fee: u32,
|
||||
}
|
||||
@@ -158,7 +158,7 @@ pub mod module {
|
||||
NetworkNameUpdated { chain_id: T::NetworkId, chain_name: Vec<u8> },
|
||||
NetworkEndpointUpdated { chain_id: T::NetworkId, default_endpoint: Vec<u8> },
|
||||
NetworkFinalityDelayUpdated { chain_id: T::NetworkId, finality_delay: Option<u64> },
|
||||
NetworkReleaseDelayUpdated { chain_id: T::NetworkId, release_delay: Option<u64> },
|
||||
NetworkBlockDistanceUpdated { chain_id: T::NetworkId, block_distance: u64 },
|
||||
NetworkTypeUpdated { chain_id: T::NetworkId, network_type: NetworkType },
|
||||
NetworkGatekeeperUpdated { chain_id: T::NetworkId, gatekeeper: Vec<u8> },
|
||||
NetworkTopicNameUpdated { chain_id: T::NetworkId, topic_name: Vec<u8> },
|
||||
@@ -303,16 +303,16 @@ pub mod module {
|
||||
}
|
||||
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(T::WeightInfo::update_network_release_delay())]
|
||||
pub fn update_network_release_delay(
|
||||
#[pallet::weight(T::WeightInfo::update_network_block_distance())]
|
||||
pub fn update_network_block_distance(
|
||||
origin: OriginFor<T>,
|
||||
chain_id: T::NetworkId,
|
||||
release_delay: Option<u64>,
|
||||
block_distance: u64,
|
||||
) -> DispatchResult {
|
||||
T::UpdateOrigin::ensure_origin_or_root(origin)?;
|
||||
Self::do_update_network_release_delay(
|
||||
Self::do_update_network_block_distance(
|
||||
chain_id,
|
||||
release_delay,
|
||||
block_distance,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -484,21 +484,21 @@ impl<T: Config> Pallet<T> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Update existent network default endpoint.
|
||||
pub fn do_update_network_release_delay(
|
||||
/// Update existent network default max distance between blocks.
|
||||
pub fn do_update_network_block_distance(
|
||||
chain_id: T::NetworkId,
|
||||
release_delay: Option<u64>,
|
||||
block_distance: u64,
|
||||
) -> DispatchResult {
|
||||
Networks::<T>::try_mutate(&chain_id, |maybe_network| -> DispatchResult {
|
||||
ensure!(maybe_network.is_some(), Error::<T>::NetworkDoesNotExist);
|
||||
let net = maybe_network.as_mut().unwrap();
|
||||
net.release_delay = release_delay;
|
||||
net.block_distance = block_distance;
|
||||
*maybe_network = Some(net.clone());
|
||||
Ok(())
|
||||
})?;
|
||||
Self::deposit_event(Event::<T>::NetworkReleaseDelayUpdated {
|
||||
Self::deposit_event(Event::<T>::NetworkBlockDistanceUpdated {
|
||||
chain_id,
|
||||
release_delay,
|
||||
block_distance,
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user