hard_fork_info

This commit is contained in:
hinto.janai 2024-10-14 16:57:10 -04:00
parent 9422c07cc8
commit 50bd576bb1
No known key found for this signature in database
GPG key ID: D47CE05FA175A499

View file

@ -380,20 +380,24 @@ async fn hard_fork_info(
let hard_fork = if request.version > 0 { let hard_fork = if request.version > 0 {
HardFork::from_version(request.version)? HardFork::from_version(request.version)?
} else { } else {
// blockchain::current_hard_fork(&mut state).await? blockchain_context::context(&mut state.blockchain_context)
todo!() .await?
.unchecked_blockchain_context()
.current_hf
}; };
let info = blockchain_context::hard_fork_info(&mut state.blockchain_context, hard_fork).await?;
Ok(HardForkInfoResponse { Ok(HardForkInfoResponse {
base: AccessResponseBase::ok(), base: AccessResponseBase::ok(),
earliest_height: todo!(), earliest_height: info.earliest_height,
enabled: todo!("hard_fork.is_latest() is not always correct"), enabled: info.enabled,
state: todo!(), state: info.state,
threshold: todo!(), threshold: info.threshold,
version: hard_fork.as_u8(), version: info.version,
votes: todo!(), votes: info.votes,
voting: todo!(), voting: info.voting,
window: todo!(), window: info.window,
}) })
} }