Skip to content

Commit

Permalink
Use genesis_fork_version from ChainConfig in /eth/v1/beacon/genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumas committed Mar 22, 2024
1 parent 7d94290 commit 0fc7272
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http_api/src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,15 @@ pub struct RemoteKeysDeleteQuery {

/// `GET /eth/v1/beacon/genesis`
pub async fn genesis<P: Preset>(
State(chain_config): State<Arc<ChainConfig>>,
State(genesis_provider): State<GenesisProvider<P>>,
) -> Result<EthResponse<GetGenesisResponse>, Error> {
let genesis_state = genesis_provider.state();

let response = GetGenesisResponse {
genesis_time: genesis_state.genesis_time(),
genesis_validators_root: genesis_state.genesis_validators_root(),
genesis_fork_version: genesis_state.fork().current_version,
genesis_fork_version: chain_config.genesis_fork_version,
};

Ok(EthResponse::json(response))
Expand Down

0 comments on commit 0fc7272

Please sign in to comment.