message: Added round to block metadata
diff: @@ -16,6 +16,7 @@ pub enum Proposer {
  pub enum Entry {
  Proposer(Proposer),
  Timestamp(u64),
  + Round(u64),
  }
  impl FromStr for Entry {
  @@ -46,6 +47,14 @@ impl FromStr for Entry {
  if let Some(s) = strip(s, "block-time:") {
  return Ok(Entry::Timestamp(s.parse::<u64>()?));
  }
  +
  + if let Some(s) = strip(s, "round:") {
  + if s.is_empty() {
  + return Ok(Entry::Round(0));
  + }
  + return Ok(Entry::Round(s.parse::<u64>()?));
  + }
  +
  Err(ErrorKind::Other(format!(
  "failed to parse '{}' as transaction config entry",
  s
  @@ -76,6 +85,7 @@ impl Entry {
  pub fn build_block_metadata(config: &GlobalConfig, entries: &[Entry]) -> Result<BlockMetadata> {
  let mut timestamp = None;
  let mut proposer = None;
  + let mut round = 0;
  for entry in entries {
  match entry {
  Entry::Proposer(s) => {
  @@ -85,11 +95,12 @@ pub fn build_block_metadata(config: &GlobalConfig, entries: &[Entry]) -> Result<
  };
  }
  Entry::Timestamp(new_timestamp) => timestamp = Some(new_timestamp),
  + Entry::Round(new_round) => round = *new_round
  }
  }
  if let (Some(t), Some(addr)) = (timestamp, proposer) {
  // TODO: Add parser for hash value and vote maps.
  - Ok(BlockMetadata::new(HashValue::zero(), 0, *t, vec![], addr))
  + Ok(BlockMetadata::new(HashValue::zero(), round, *t, vec![], addr))
  } else {
  Err(ErrorKind::Other("Cannot generate block metadata".to_string()).into())
  }
  