Skip to content

Commit

Permalink
tendermint-proxy: use _nanos_opt()
Browse files Browse the repository at this point in the history
  • Loading branch information
avahowell committed Sep 20, 2023
1 parent 3d8d3e6 commit 4cd7c3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/util/tendermint-proxy/src/tendermint_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl TendermintProxyService for TendermintProxy {
height: res.block.header.height.into(),
time: Some(pbjson_types::Timestamp {
seconds: header_time.timestamp(),
nanos: header_time.timestamp_nanos() as i32,
nanos: header_time.timestamp_nanos_opt().unwrap() as i32,
}),
last_block_id: res.block.header.last_block_id.map(|id| {
penumbra_proto::tendermint::types::BlockId {
Expand Down Expand Up @@ -396,7 +396,7 @@ impl TendermintProxyService for TendermintProxy {
}),
timestamp: Some(pbjson_types::Timestamp{
seconds: DateTime::parse_from_rfc3339(&e.votes().0.timestamp.expect("timestamp").to_rfc3339()).expect("timestamp should roundtrip to string").timestamp(),
nanos: DateTime::parse_from_rfc3339(&e.votes().0.timestamp.expect("timestamp").to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos() as i32,
nanos: DateTime::parse_from_rfc3339(&e.votes().0.timestamp.expect("timestamp").to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos_opt().unwrap() as i32,
}),
validator_address: e.votes().0.validator_address.into(),
validator_index: e.votes().0.validator_index.into(),
Expand All @@ -418,7 +418,7 @@ impl TendermintProxyService for TendermintProxy {
}),
timestamp: Some(pbjson_types::Timestamp{
seconds: DateTime::parse_from_rfc3339(&e.votes().1.timestamp.expect("timestamp").to_rfc3339()).expect("timestamp should roundtrip to string").timestamp(),
nanos: DateTime::parse_from_rfc3339(&e.votes().1.timestamp.expect("timestamp").to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos() as i32,
nanos: DateTime::parse_from_rfc3339(&e.votes().1.timestamp.expect("timestamp").to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos_opt().unwrap() as i32,
}),
validator_address: e.votes().1.validator_address.into(),
validator_index: e.votes().1.validator_index.into(),
Expand Down Expand Up @@ -470,7 +470,7 @@ impl TendermintProxyService for TendermintProxy {
validator_address: validator_address.into(),
timestamp: Some(pbjson_types::Timestamp{
seconds: DateTime::parse_from_rfc3339(&timestamp.to_rfc3339()).expect("timestamp should roundtrip to string").timestamp(),
nanos: DateTime::parse_from_rfc3339(&timestamp.to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos() as i32,
nanos: DateTime::parse_from_rfc3339(&timestamp.to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos_opt().unwrap() as i32,
}),
signature: signature.expect("signature").into(),
},
Expand All @@ -479,7 +479,7 @@ impl TendermintProxyService for TendermintProxy {
validator_address: validator_address.into(),
timestamp: Some(pbjson_types::Timestamp{
seconds: DateTime::parse_from_rfc3339(&timestamp.to_rfc3339()).expect("timestamp should roundtrip to string").timestamp(),
nanos: DateTime::parse_from_rfc3339(&timestamp.to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos() as i32,
nanos: DateTime::parse_from_rfc3339(&timestamp.to_rfc3339()).expect("timestamp should roundtrip to string").timestamp_nanos_opt().unwrap() as i32,
}),
signature: signature.expect("signature").into(),
},
Expand Down

0 comments on commit 4cd7c3e

Please sign in to comment.