Fixed parsing error in 'progress' field for VotingToChangeMinThreshold --v2 contract's ballot-info.

This commit is contained in:
DrPeterVanNostrand 2018-12-12 00:09:40 +00:00
parent dea5f1fa58
commit 2489bbb660
1 changed files with 4 additions and 4 deletions

View File

@ -161,7 +161,7 @@ pub struct ThresholdBallotInfo {
pub creator: Address, pub creator: Address,
pub memo: String, pub memo: String,
pub can_be_finalized_now: bool, pub can_be_finalized_now: bool,
// pub already_voted: bool, pub already_voted: bool,
} }
impl From<Vec<ethabi::Token>> for ThresholdBallotInfo { impl From<Vec<ethabi::Token>> for ThresholdBallotInfo {
@ -175,13 +175,13 @@ impl From<Vec<ethabi::Token>> for ThresholdBallotInfo {
u256_to_datetime(uint) u256_to_datetime(uint)
}; };
let total_voters = tokens[2].clone().to_uint().unwrap(); let total_voters = tokens[2].clone().to_uint().unwrap();
let progress = tokens[3].clone().to_uint().unwrap(); let progress = tokens[3].clone().to_int().unwrap();
let is_finalized = tokens[4].clone().to_bool().unwrap(); let is_finalized = tokens[4].clone().to_bool().unwrap();
let proposed_value = tokens[5].clone().to_uint().unwrap(); let proposed_value = tokens[5].clone().to_uint().unwrap();
let creator = tokens[6].clone().to_address().unwrap(); let creator = tokens[6].clone().to_address().unwrap();
let memo = tokens[7].clone().to_string().unwrap(); let memo = tokens[7].clone().to_string().unwrap();
let can_be_finalized_now = tokens[8].clone().to_bool().unwrap(); let can_be_finalized_now = tokens[8].clone().to_bool().unwrap();
// let already_voted = tokens[9].clone().to_bool().unwrap(); let already_voted = tokens[9].clone().to_bool().unwrap();
ThresholdBallotInfo { ThresholdBallotInfo {
start_time, start_time,
end_time, end_time,
@ -192,7 +192,7 @@ impl From<Vec<ethabi::Token>> for ThresholdBallotInfo {
creator, creator,
memo, memo,
can_be_finalized_now, can_be_finalized_now,
// already_voted, already_voted,
} }
} }
} }