make default and stored RPC endpoints to match the current chain id
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
834b070bee
commit
df818a433a
@ -2,7 +2,7 @@
|
||||
name = "ghost-eye"
|
||||
authors = ["str3tch <stretch@ghostchain.io>"]
|
||||
description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost"
|
||||
version = "0.3.87"
|
||||
version = "0.3.88"
|
||||
edition = "2021"
|
||||
homepage = "https://git.ghostchain.io/ghostchain"
|
||||
repository = "https://git.ghostchain.io/ghostchain/ghost-eye"
|
||||
|
||||
@ -132,7 +132,7 @@ pub enum Action {
|
||||
SetChoosenValidator([u8; 32], u32, u32),
|
||||
SetChoosenGatekeeper(u64),
|
||||
SetSlashingSpansLength(usize, [u8; 32]),
|
||||
SetStoredRpcEndpoints(Vec<String>),
|
||||
SetStoredRpcEndpoints(u64, Vec<String>),
|
||||
SetRateLimitDelay(u64, u64),
|
||||
UpdateStoredRpcEndpoints(u64, Vec<String>),
|
||||
|
||||
|
||||
@ -53,6 +53,7 @@ impl GatekeeperEndpoints {
|
||||
self.chain_id = chain_id;
|
||||
if let Some(network_tx) = &self.network_tx {
|
||||
let _ = network_tx.send(Action::GetRpcEndpoints(chain_id));
|
||||
let _ = network_tx.send(Action::GetGatekeepedNetwork(chain_id));
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,10 +323,14 @@ impl Component for GatekeeperEndpoints {
|
||||
}
|
||||
}
|
||||
Action::SetGatekeepedNetwork(network) => {
|
||||
self.default_endpoints = network.default_endpoints
|
||||
if network.chain_id == self.chain_id {
|
||||
self.default_endpoints = network.default_endpoints;
|
||||
}
|
||||
}
|
||||
Action::SetStoredRpcEndpoints(chain_id, stored_endpoints) => {
|
||||
if chain_id == self.chain_id {
|
||||
self.stored_endpoints = stored_endpoints;
|
||||
}
|
||||
Action::SetStoredRpcEndpoints(stored_endpoints) => {
|
||||
self.stored_endpoints = stored_endpoints
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
|
||||
@ -266,7 +266,7 @@ pub async fn get_stored_rpc_endpoints(
|
||||
.ok()
|
||||
.unwrap_or_default();
|
||||
|
||||
action_tx.send(Action::SetStoredRpcEndpoints(stored_rpc_endpoints))?;
|
||||
action_tx.send(Action::SetStoredRpcEndpoints(chain_id, stored_rpc_endpoints))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user