mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-03-16 00:41:54 +00:00
hard_fork_info
This commit is contained in:
parent
9422c07cc8
commit
50bd576bb1
1 changed files with 14 additions and 10 deletions
|
@ -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,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue