From 6723b4ce0e34fac5655014a0121cb0f7f0ac9b33 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Fri, 14 Jun 2024 11:50:09 -0300 Subject: [PATCH 1/2] use constant --- zebra-chain/src/sapling/keys.rs | 2 +- zebra-chain/src/serialization/tests/preallocate.rs | 2 +- zebra-chain/src/work/difficulty/arbitrary.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zebra-chain/src/sapling/keys.rs b/zebra-chain/src/sapling/keys.rs index 7b6e783b8c3..0e395c59eda 100644 --- a/zebra-chain/src/sapling/keys.rs +++ b/zebra-chain/src/sapling/keys.rs @@ -91,7 +91,7 @@ pub(super) fn find_group_hash(d: [u8; 8], m: &[u8]) -> jubjub::ExtendedPoint { let gh = jubjub_group_hash(d, &tag[..]); // We don't want to overflow and start reusing generators - assert!(tag[i] != u8::max_value()); + assert!(tag[i] != u8::MAX); tag[i] += 1; if let Some(gh) = gh { diff --git a/zebra-chain/src/serialization/tests/preallocate.rs b/zebra-chain/src/serialization/tests/preallocate.rs index 405fd13659f..f84e906c39c 100644 --- a/zebra-chain/src/serialization/tests/preallocate.rs +++ b/zebra-chain/src/serialization/tests/preallocate.rs @@ -77,7 +77,7 @@ fn u8_deser_throws_when_input_too_large() { /// Confirm that every u8 takes exactly 1 byte when serialized. /// This verifies that our calculated `MAX_U8_ALLOCATION` is indeed an upper bound. fn u8_size_is_correct() { - for byte in std::u8::MIN..=std::u8::MAX { + for byte in u8::MIN..=u8::MAX { let serialized = byte .zcash_serialize_to_vec() .expect("Serialization to vec must succeed"); diff --git a/zebra-chain/src/work/difficulty/arbitrary.rs b/zebra-chain/src/work/difficulty/arbitrary.rs index 96d1f905358..de6ea9ca6e7 100644 --- a/zebra-chain/src/work/difficulty/arbitrary.rs +++ b/zebra-chain/src/work/difficulty/arbitrary.rs @@ -49,7 +49,7 @@ impl Arbitrary for Work { // In the Zcash protocol, a Work is converted from an ExpandedDifficulty. // But some randomised difficulties are impractically large, and will // never appear in any real-world block. So we just use a random Work value. - (1..std::u128::MAX).prop_map(Work).boxed() + (1..u128::MAX).prop_map(Work).boxed() } type Strategy = BoxedStrategy; From 1577f9f671217c31979c6d569db58e618382609d Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Fri, 14 Jun 2024 12:37:33 -0300 Subject: [PATCH 2/2] fix typos --- book/src/dev/rfcs/0009-zebra-client.md | 2 +- zebra-grpc/src/tests/snapshot.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/book/src/dev/rfcs/0009-zebra-client.md b/book/src/dev/rfcs/0009-zebra-client.md index 38aa720ca4d..3aa153daea6 100644 --- a/book/src/dev/rfcs/0009-zebra-client.md +++ b/book/src/dev/rfcs/0009-zebra-client.md @@ -189,7 +189,7 @@ A specific set of _privileged_ RPC endpoints: via a firewall) Support for sending tx's via _non-privileged_ RPC endpoints, or via Stolon: - - sendTransaction: once you author a transcation you can gossip it via any + - sendTransaction: once you author a transaction you can gossip it via any Zcash node, not just a specific instance of zebrad ## Wallet functionality diff --git a/zebra-grpc/src/tests/snapshot.rs b/zebra-grpc/src/tests/snapshot.rs index 4fb589d7a3e..92e8b77aa8d 100644 --- a/zebra-grpc/src/tests/snapshot.rs +++ b/zebra-grpc/src/tests/snapshot.rs @@ -1,7 +1,7 @@ //! Snapshot tests for Zebra Scan gRPC responses. //! //! Currently we snapshot the `get_info` and `get_results` responses for both mainnet and testnet with a -//! mocked scanner database. Calls that return `Empty` responses are not snapshoted in this suite. +//! mocked scanner database. Calls that return `Empty` responses are not snapshotted in this suite. //! //! To update these snapshots, run: //! ```sh