From 407962b864facf02d377404e2cd42e269b952f6b Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 13 Oct 2020 07:35:51 +1000 Subject: [PATCH] Rename any remaining is_time_valid_at instances Automated search and replace, using the script: sed -i 's/is_time_valid_at/time_is_valid_at/' \ $(grep -r is_time_valid_at zebra* | cut -d: -f1 | sort -u) --- zebra-chain/src/block/header.rs | 4 ++-- zebra-chain/src/block/tests/vectors.rs | 6 +++--- zebra-consensus/src/block/check.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zebra-chain/src/block/header.rs b/zebra-chain/src/block/header.rs index 110b859ae..9a0c24434 100644 --- a/zebra-chain/src/block/header.rs +++ b/zebra-chain/src/block/header.rs @@ -83,9 +83,9 @@ pub enum BlockTimeError { } impl Header { - /// TODO: Inline this function into zebra_consensus::block::check::is_time_valid_at. + /// TODO: Inline this function into zebra_consensus::block::check::time_is_valid_at. /// See https://github.com/ZcashFoundation/zebra/issues/1021 for more details. - pub fn is_time_valid_at( + pub fn time_is_valid_at( &self, now: DateTime, height: &Height, diff --git a/zebra-chain/src/block/tests/vectors.rs b/zebra-chain/src/block/tests/vectors.rs index 1860a81e7..4cf04ccef 100644 --- a/zebra-chain/src/block/tests/vectors.rs +++ b/zebra-chain/src/block/tests/vectors.rs @@ -186,10 +186,10 @@ fn block_limits_single_tx() { Block::zcash_deserialize(&data[..]).expect_err("block should not deserialize"); } -/// Test wrapper for `BlockHeader.is_time_valid_at`. +/// Test wrapper for `BlockHeader.time_is_valid_at`. /// /// Generates a block header, sets its `time` to `block_header_time`, then -/// calls `is_time_valid_at`. +/// calls `time_is_valid_at`. fn node_time_check( block_header_time: DateTime, now: DateTime, @@ -197,7 +197,7 @@ fn node_time_check( let mut header = generate::block_header(); header.time = block_header_time; // pass a zero height and hash - they are only used in the returned error - header.is_time_valid_at(now, &Height(0), &Hash([0; 32])) + header.time_is_valid_at(now, &Height(0), &Hash([0; 32])) } #[test] diff --git a/zebra-consensus/src/block/check.rs b/zebra-consensus/src/block/check.rs index 1ec64de22..0eb97a9ec 100644 --- a/zebra-consensus/src/block/check.rs +++ b/zebra-consensus/src/block/check.rs @@ -94,7 +94,7 @@ pub fn time_is_valid_at( height: &Height, hash: &Hash, ) -> Result<(), zebra_chain::block::BlockTimeError> { - header.is_time_valid_at(now, height, hash) + header.time_is_valid_at(now, height, hash) } /// Returns `Ok(())` if the block subsidy and miner fees in `block` are valid for `network`