Skip to content

Commit ac5c3af

Browse files
author
Naohiro Yoshida
committed
refactor
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
1 parent b4600e1 commit ac5c3af

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

light-client/src/client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,13 @@ impl InnerLightClient {
166166

167167
let height = client_state.latest_height;
168168
let timestamp = consensus_state.timestamp;
169+
let milli_timestamp = (timestamp.as_unix_timestamp_nanos() / 1_000_000) as u64;
169170

170171
#[allow(clippy::absurd_extreme_comparisons)]
171-
if timestamp.as_unix_timestamp_secs() < MINIMUM_TIMESTAMP_SUPPORTED {
172+
if milli_timestamp < MINIMUM_TIMESTAMP_SUPPORTED {
172173
return Err(Error::UnsupportedMinimumTimestamp(timestamp));
173174
}
175+
174176
#[allow(clippy::absurd_extreme_comparisons)]
175177
if height.revision_height() < MINIMUM_HEIGHT_SUPPORTED {
176178
return Err(Error::UnsupportedMinimumHeight(height));
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pub const BLOCKS_PER_EPOCH: u64 = 500;
2-
pub const MINIMUM_TIMESTAMP_SUPPORTED: u64 = 110;
3-
pub const MINIMUM_HEIGHT_SUPPORTED: u64 = 100;
2+
pub const MINIMUM_TIMESTAMP_SUPPORTED: u64 = 0;
3+
pub const MINIMUM_HEIGHT_SUPPORTED: u64 = 0;

light-client/src/header/eth_headers.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ fn verify_voters(
276276
mod test {
277277
use crate::errors::Error;
278278

279-
use crate::header::eth_header::{
280-
get_validator_bytes_and_turn_length, ETHHeader,
281-
};
279+
use crate::header::eth_header::{get_validator_bytes_and_turn_length, ETHHeader};
282280
use crate::header::eth_headers::{verify_voters, ETHHeaders};
283281

284282
use crate::fixture::*;

0 commit comments

Comments
 (0)