mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Simplify ConfigAndPreset (#7777)
I noticed that we are serving preset values for Fulu on mainnet nodes prior to the fork. This has already gone live in v7.1.0, but should hopefully be handled in a graceful way by API consumers. This PR _reverts_ the serving of Fulu data prior to Fulu, by serving Fulu data only if Fulu is scheduled.
This commit is contained in:
@@ -2616,13 +2616,19 @@ impl ApiTester {
|
||||
}
|
||||
|
||||
pub async fn test_get_config_spec(self) -> Self {
|
||||
let result = self
|
||||
.client
|
||||
.get_config_spec::<ConfigAndPresetFulu>()
|
||||
.await
|
||||
.map(|res| ConfigAndPreset::Fulu(res.data))
|
||||
.unwrap();
|
||||
let expected = ConfigAndPreset::from_chain_spec::<E>(&self.chain.spec, None);
|
||||
let result = if self.chain.spec.is_fulu_scheduled() {
|
||||
self.client
|
||||
.get_config_spec::<ConfigAndPresetFulu>()
|
||||
.await
|
||||
.map(|res| ConfigAndPreset::Fulu(res.data))
|
||||
} else {
|
||||
self.client
|
||||
.get_config_spec::<ConfigAndPresetElectra>()
|
||||
.await
|
||||
.map(|res| ConfigAndPreset::Electra(res.data))
|
||||
}
|
||||
.unwrap();
|
||||
let expected = ConfigAndPreset::from_chain_spec::<E>(&self.chain.spec);
|
||||
|
||||
assert_eq!(result, expected);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user