diff --git a/tig-protocol/src/contracts/players.rs b/tig-protocol/src/contracts/players.rs index 652d1e35..7991a8c0 100644 --- a/tig-protocol/src/contracts/players.rs +++ b/tig-protocol/src/contracts/players.rs @@ -212,8 +212,8 @@ pub async fn set_vote( .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)); } diff --git a/tig-structs/src/config.rs b/tig-structs/src/config.rs index 4da83dac..2c825636 100644 --- a/tig-structs/src/config.rs +++ b/tig-structs/src/config.rs @@ -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, diff --git a/tig-structs/src/core.rs b/tig-structs/src/core.rs index 6b885642..553972c1 100644 --- a/tig-structs/src/core.rs +++ b/tig-structs/src/core.rs @@ -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, round_active: Option,