mirror of
https://github.com/tig-pool-nk/tig-monorepo.git
synced 2026-02-21 17:17:22 +08:00
Add delay before voting begins.
This commit is contained in:
parent
715da6cd69
commit
14373ff80c
@ -212,8 +212,8 @@ pub async fn set_vote<T: Context>(
|
||||
.get_breakthrough_state(&breakthrough_id)
|
||||
.await
|
||||
.ok_or_else(|| anyhow!("Invalid breakthrough '{}'", breakthrough_id))?;
|
||||
if breakthrough_state.round_pushed > latest_block_details.round
|
||||
&& latest_block_details.round >= breakthrough_state.round_votes_tallied
|
||||
if latest_block_details.round < breakthrough_state.round_voting_starts
|
||||
|| latest_block_details.round >= breakthrough_state.round_votes_tallied
|
||||
{
|
||||
return Err(anyhow!("Cannot vote on breakthrough '{}'", breakthrough_id));
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ serializable_struct_with_getters! {
|
||||
BreakthroughsConfig {
|
||||
bootstrap_address: String,
|
||||
min_percent_yes_votes: f64,
|
||||
vote_start_delay: u32,
|
||||
vote_period: u32,
|
||||
min_lock_period_to_vote: u32,
|
||||
submission_fee: PreciseNumber,
|
||||
|
||||
@ -272,6 +272,7 @@ serializable_struct_with_getters! {
|
||||
block_confirmed: u32,
|
||||
round_submitted: u32,
|
||||
round_pushed: u32,
|
||||
round_voting_starts: u32,
|
||||
round_votes_tallied: u32,
|
||||
votes_tally: HashMap<bool, PreciseNumber>,
|
||||
round_active: Option<u32>,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user