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)
This commit is contained in:
parent
d504232720
commit
407962b864
|
@ -83,9 +83,9 @@ pub enum BlockTimeError {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Header {
|
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.
|
/// See https://github.com/ZcashFoundation/zebra/issues/1021 for more details.
|
||||||
pub fn is_time_valid_at(
|
pub fn time_is_valid_at(
|
||||||
&self,
|
&self,
|
||||||
now: DateTime<Utc>,
|
now: DateTime<Utc>,
|
||||||
height: &Height,
|
height: &Height,
|
||||||
|
|
|
@ -186,10 +186,10 @@ fn block_limits_single_tx() {
|
||||||
Block::zcash_deserialize(&data[..]).expect_err("block should not deserialize");
|
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
|
/// 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(
|
fn node_time_check(
|
||||||
block_header_time: DateTime<Utc>,
|
block_header_time: DateTime<Utc>,
|
||||||
now: DateTime<Utc>,
|
now: DateTime<Utc>,
|
||||||
|
@ -197,7 +197,7 @@ fn node_time_check(
|
||||||
let mut header = generate::block_header();
|
let mut header = generate::block_header();
|
||||||
header.time = block_header_time;
|
header.time = block_header_time;
|
||||||
// pass a zero height and hash - they are only used in the returned error
|
// 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]
|
#[test]
|
||||||
|
|
|
@ -94,7 +94,7 @@ pub fn time_is_valid_at(
|
||||||
height: &Height,
|
height: &Height,
|
||||||
hash: &Hash,
|
hash: &Hash,
|
||||||
) -> Result<(), zebra_chain::block::BlockTimeError> {
|
) -> 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`
|
/// Returns `Ok(())` if the block subsidy and miner fees in `block` are valid for `network`
|
||||||
|
|
Loading…
Reference in New Issue