Merge pull request #347 from str4d/small-dep-updates

Small dependency updates
This commit is contained in:
str4d 2021-03-06 04:47:06 +13:00 committed by GitHub
commit c724ed1796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 58 additions and 55 deletions

View File

@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.44.1
toolchain: 1.47.0
override: true
- name: Fetch path to Zcash parameters
@ -56,7 +56,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.44.1
toolchain: 1.47.0
override: true
- name: Add target
run: rustup target add ${{ matrix.target }}
@ -79,7 +79,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.44.1
toolchain: 1.47.0
override: true
# Build benchmarks to prevent bitrot
- name: Build benchmarks
@ -89,20 +89,20 @@ jobs:
args: --all --benches
clippy:
name: Clippy (1.44.1)
name: Clippy (1.47.0)
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.44.1
toolchain: 1.47.0
components: clippy
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: Clippy (1.44.1)
name: Clippy (1.47.0)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
@ -199,7 +199,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.44.1
toolchain: 1.47.0
override: true
# cargo fmt does not build the code, and running it in a fresh clone of

View File

@ -1 +1 @@
1.44.1
1.47.0

View File

@ -16,6 +16,7 @@ and this library adheres to Rust's notion of
- First alpha of TZE support, behind the `zfuture` feature flag.
### Changed
- MSRV is now 1.47.0.
- `epk` fields and return values were changed from a `jubjub::SubgroupPoint` to
a `jubjub::ExtendedPoint`, to match the change to the `zcash_primitives`
decryption APIs:

View File

@ -14,13 +14,13 @@ edition = "2018"
[dependencies]
bech32 = "0.7"
bls12_381 = "0.3.1"
bs58 = { version = "0.3", features = ["check"] }
base64 = "0.12.3"
bs58 = { version = "0.4", features = ["check"] }
base64 = "0.13"
ff = "0.8"
group = "0.8"
hex = "0.4"
jubjub = "0.5.1"
nom = "5.1.2"
nom = "6.1"
protobuf = "2.20"
rand_core = "0.5.1"
subtle = "2.2.3"

View File

@ -194,7 +194,7 @@ where
/// [`init_blocks_table`] before this function.
///
/// Scanned blocks are required to be height-sequential. If a block is missing from the
/// cache, an error will be returned with kind [`ChainInvalid::HeightMismatch`].
/// cache, an error will be returned with kind [`ChainInvalid::BlockHeightDiscontinuity`].
///
/// # Examples
///

View File

@ -81,6 +81,8 @@ pub enum OvkPolicy {
///
/// Transaction outputs will be decryptable by the sender, in addition to the
/// recipients.
///
/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey
Sender,
/// Use a custom outgoing viewing key. This might for instance be derived from a

View File

@ -22,6 +22,8 @@ use crate::wallet::{AccountId, WalletShieldedOutput, WalletShieldedSpend, Wallet
///
/// The given [`CommitmentTree`] and existing [`IncrementalWitness`]es are incremented
/// with this output's commitment.
///
/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey
#[allow(clippy::too_many_arguments)]
fn scan_output<P: consensus::Parameters>(
params: &P,
@ -87,6 +89,8 @@ fn scan_output<P: consensus::Parameters>(
///
/// The given [`CommitmentTree`] and existing [`IncrementalWitness`]es are
/// incremented appropriately.
///
/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey
pub fn scan_block<P: consensus::Parameters>(
params: &P,
block: CompactBlock,

View File

@ -5,7 +5,8 @@ use std::fmt;
use std::str::FromStr;
use nom::{
character::complete::char, combinator::all_consuming, multi::separated_list, sequence::preceded,
character::complete::char, combinator::all_consuming, multi::separated_list0,
sequence::preceded,
};
use zcash_primitives::{consensus, transaction::components::Amount};
@ -248,7 +249,7 @@ impl TransactionRequest {
// Parse the remaining parameters as an undifferentiated list
let (_, xs) = all_consuming(preceded(
char('?'),
separated_list(char('&'), parse::zcashparam(params)),
separated_list0(char('&'), parse::zcashparam(params)),
))(rest)
.map_err(|e| e.to_string())?;

View File

@ -20,6 +20,7 @@ same as before, but have been reorganized.
- `zcash_client_sqlite::NoteId`
### Changed
- MSRV is now 1.47.0.
- APIs now take `&BlockDB` and `&WalletDB<P>` arguments, instead of paths to the
block cache and wallet databases.
- The library no longer uses the `mainnet` feature flag to specify the network

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies]
bech32 = "0.7"
bs58 = { version = "0.3", features = ["check"] }
bs58 = { version = "0.4", features = ["check"] }
ff = "0.8"
group = "0.8"
jubjub = "0.5.1"

View File

@ -22,7 +22,7 @@
//! default, the light client is configured for use with the Zcash testnet.
//!
//! [`CompactBlock`]: zcash_client_backend::proto::compact_formats::CompactBlock
//! [`init_cache_database`]: crate::init::init_cache_database
//! [`init_cache_database`]: crate::chain::init::init_cache_database
use std::collections::HashMap;
use std::fmt;

View File

@ -112,7 +112,7 @@ pub fn init_wallet_db<P>(wdb: &WalletDB<P>) -> Result<(), rusqlite::Error> {
/// Initialises the data database with the given [`ExtendedFullViewingKey`]s.
///
/// The [`ExtendedFullViewingKey`]s are stored internally and used by other APIs such as
/// [`get_address`], [`scan_cached_blocks`], and [`create_to_address`]. `extfvks` **MUST**
/// [`get_address`], [`scan_cached_blocks`], and [`create_spend_to_address`]. `extfvks` **MUST**
/// be arranged in account-order; that is, the [`ExtendedFullViewingKey`] for ZIP 32
/// account `i` **MUST** be at `extfvks[i]`.
///
@ -141,8 +141,8 @@ pub fn init_wallet_db<P>(wdb: &WalletDB<P>) -> Result<(), rusqlite::Error> {
/// ```
///
/// [`get_address`]: crate::wallet::get_address
/// [`scan_cached_blocks`]: crate::scan::scan_cached_blocks
/// [`create_to_address`]: crate::transact::create_to_address
/// [`scan_cached_blocks`]: zcash_client_backend::data_api::chain::scan_cached_blocks
/// [`create_spend_to_address`]: zcash_client_backend::data_api::wallet::create_spend_to_address
pub fn init_accounts_table<P: consensus::Parameters>(
wdb: &WalletDB<P>,
extfvks: &[ExtendedFullViewingKey],

View File

@ -34,11 +34,7 @@ impl Entry {
/// Is this node a leaf.
pub fn leaf(&self) -> bool {
if let EntryKind::Leaf = self.kind {
true
} else {
false
}
matches!(self.kind, EntryKind::Leaf)
}
/// Left child

View File

@ -648,7 +648,7 @@ mod tests {
tree.truncate_leaf().expect("Failed to truncate");
}
TestResult::from_bool(if let EntryLink::Stored(2) = tree.root() { true } else { false })
TestResult::from_bool(matches!(tree.root(), EntryLink::Stored(2)))
}
}
@ -678,12 +678,9 @@ mod tests {
TestResult::from_bool(
if number & (number - 1) == 0 {
if let EntryLink::Stored(_) = tree.root() { true }
else { false }
} else if let EntryLink::Generated(_) = tree.root() {
true
matches!(tree.root(), EntryLink::Stored(_))
} else {
false
matches!(tree.root(), EntryLink::Generated(_))
}
)
}
@ -707,12 +704,9 @@ mod tests {
TestResult::from_bool(
if total & (total - 1) == 0 {
if let EntryLink::Stored(_) = tree.root() { true }
else { false }
} else if let EntryLink::Generated(_) = tree.root() {
true
matches!(tree.root(), EntryLink::Stored(_))
} else {
false
matches!(tree.root(), EntryLink::Generated(_))
}
)
}

View File

@ -73,6 +73,7 @@ and this library adheres to Rust's notion of
- `zcash_primitives::zip32::DiversifierIndex: Default`
### Changed
- MSRV is now 1.47.0.
- Trial decryption using the APIs in `zcash_primitives::note_encryption` is now
over 60% faster at detecting which notes are relevant.
- Part of this improvement was achieved by changing the APIs to take `epk` as

View File

@ -15,7 +15,7 @@ edition = "2018"
all-features = true
[dependencies]
aes = "0.5"
aes = "0.6"
bitvec = "0.18"
blake2b_simd = "0.5"
blake2s_simd = "0.5"
@ -24,7 +24,7 @@ byteorder = "1"
crypto_api_chachapoly = "0.4"
equihash = { version = "0.1", path = "../components/equihash" }
ff = "0.8"
fpe = "0.3"
fpe = "0.4"
group = "0.8"
hex = "0.4"
jubjub = "0.5.1"
@ -34,7 +34,7 @@ proptest = { version = "0.10.1", optional = true }
rand = "0.7"
rand_core = "0.5.1"
ripemd160 = { version = "0.9", optional = true }
secp256k1 = { version = "0.19", optional = true }
secp256k1 = { version = "0.20", optional = true }
sha2 = "0.9"
subtle = "2.2.3"
@ -43,7 +43,7 @@ funty = "=1.1.0"
[dev-dependencies]
criterion = "0.3"
hex-literal = "0.2"
hex-literal = "0.3"
proptest = "0.10.1"
rand_xorshift = "0.2"

View File

@ -352,7 +352,7 @@ pub enum NetworkUpgrade {
///
/// [Canopy]: https://z.cash/upgrade/canopy/
Canopy,
/// The [ZFUTURE] network upgrade.
/// The ZFUTURE network upgrade.
///
/// This upgrade is expected never to activate on mainnet;
/// it is intended for use in integration testing of functionality

View File

@ -9,7 +9,7 @@ pub const COIN_TYPE: u32 = 133;
///
/// Defined in [ZIP 32].
///
/// [`ExtendedSpendingKey`]: zcash_primitives::zip32::ExtendedSpendingKey
/// [`ExtendedSpendingKey`]: crate::zip32::ExtendedSpendingKey
/// [ZIP 32]: https://github.com/zcash/zips/blob/master/zip-0032.rst
pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-main";
@ -17,7 +17,7 @@ pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-main";
///
/// Defined in [ZIP 32].
///
/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey
/// [`ExtendedFullViewingKey`]: crate::zip32::ExtendedFullViewingKey
/// [ZIP 32]: https://github.com/zcash/zips/blob/master/zip-0032.rst
pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviews";
@ -25,16 +25,16 @@ pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviews";
///
/// Defined in section 5.6.4 of the [Zcash Protocol Specification].
///
/// [`PaymentAddress`]: zcash_primitives::primitives::PaymentAddress
/// [`PaymentAddress`]: crate::primitives::PaymentAddress
/// [Zcash Protocol Specification]: https://github.com/zcash/zips/blob/master/protocol/protocol.pdf
pub const HRP_SAPLING_PAYMENT_ADDRESS: &str = "zs";
/// The prefix for a Base58Check-encoded mainnet [`TransparentAddress::PublicKey`].
///
/// [`TransparentAddress::PublicKey`]: zcash_primitives::legacy::TransparentAddress::PublicKey
/// [`TransparentAddress::PublicKey`]: crate::legacy::TransparentAddress::PublicKey
pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xb8];
/// The prefix for a Base58Check-encoded mainnet [`TransparentAddress::Script`].
///
/// [`TransparentAddress::Script`]: zcash_primitives::legacy::TransparentAddress::Script
/// [`TransparentAddress::Script`]: crate::legacy::TransparentAddress::Script
pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xbd];

View File

@ -12,7 +12,7 @@ pub const COIN_TYPE: u32 = 1;
///
/// It is defined in [the `zcashd` codebase].
///
/// [`ExtendedSpendingKey`]: zcash_primitives::zip32::ExtendedSpendingKey
/// [`ExtendedSpendingKey`]: crate::zip32::ExtendedSpendingKey
/// [the `zcashd` codebase]: https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L496
pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-regtest";
@ -20,7 +20,7 @@ pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-regtest
///
/// It is defined in [the `zcashd` codebase].
///
/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey
/// [`ExtendedFullViewingKey`]: crate::zip32::ExtendedFullViewingKey
/// [the `zcashd` codebase]: https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L494
pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewregtestsapling";
@ -28,18 +28,18 @@ pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewregtestsapling";
///
/// It is defined in [the `zcashd` codebase].
///
/// [`PaymentAddress`]: zcash_primitives::primitives::PaymentAddress
/// [`PaymentAddress`]: crate::primitives::PaymentAddress
/// [the `zcashd` codebase]: https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L493
pub const HRP_SAPLING_PAYMENT_ADDRESS: &str = "zregtestsapling";
/// The prefix for a Base58Check-encoded regtest [`TransparentAddress::PublicKey`].
/// Same as the testnet prefix.
///
/// [`TransparentAddress::PublicKey`]: zcash_primitives::legacy::TransparentAddress::PublicKey
/// [`TransparentAddress::PublicKey`]: crate::legacy::TransparentAddress::PublicKey
pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1d, 0x25];
/// The prefix for a Base58Check-encoded regtest [`TransparentAddress::Script`].
/// Same as the testnet prefix.
///
/// [`TransparentAddress::Script`]: zcash_primitives::legacy::TransparentAddress::Script
/// [`TransparentAddress::Script`]: crate::legacy::TransparentAddress::Script
pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xba];

View File

@ -9,7 +9,7 @@ pub const COIN_TYPE: u32 = 1;
///
/// Defined in [ZIP 32].
///
/// [`ExtendedSpendingKey`]: zcash_primitives::zip32::ExtendedSpendingKey
/// [`ExtendedSpendingKey`]: crate::zip32::ExtendedSpendingKey
/// [ZIP 32]: https://github.com/zcash/zips/blob/master/zip-0032.rst
pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-test";
@ -17,7 +17,7 @@ pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-test";
///
/// Defined in [ZIP 32].
///
/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey
/// [`ExtendedFullViewingKey`]: crate::zip32::ExtendedFullViewingKey
/// [ZIP 32]: https://github.com/zcash/zips/blob/master/zip-0032.rst
pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewtestsapling";
@ -25,16 +25,16 @@ pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewtestsapling";
///
/// Defined in section 5.6.4 of the [Zcash Protocol Specification].
///
/// [`PaymentAddress`]: zcash_primitives::primitives::PaymentAddress
/// [`PaymentAddress`]: crate::primitives::PaymentAddress
/// [Zcash Protocol Specification]: https://github.com/zcash/zips/blob/master/protocol/protocol.pdf
pub const HRP_SAPLING_PAYMENT_ADDRESS: &str = "ztestsapling";
/// The prefix for a Base58Check-encoded testnet [`TransparentAddress::PublicKey`].
///
/// [`TransparentAddress::PublicKey`]: zcash_primitives::legacy::TransparentAddress::PublicKey
/// [`TransparentAddress::PublicKey`]: crate::legacy::TransparentAddress::PublicKey
pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1d, 0x25];
/// The prefix for a Base58Check-encoded testnet [`TransparentAddress::Script`].
///
/// [`TransparentAddress::Script`]: zcash_primitives::legacy::TransparentAddress::Script
/// [`TransparentAddress::Script`]: crate::legacy::TransparentAddress::Script
pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xba];

View File

@ -203,6 +203,8 @@ impl TzeIn {
/// This calls [`write_without_witness`] to serialize witness metadata,
/// then appends the witness bytes themselves. This is the encoded
/// form that is used in a serialized transaction.
///
/// [`write_without_witness`]: TzeIn::write_without_witness
pub fn write<W: Write>(&self, mut writer: W) -> io::Result<()> {
self.write_without_witness(&mut writer)?;
Vector::write(&mut writer, &self.witness.payload, |w, b| w.write_u8(*b))

View File

@ -25,6 +25,7 @@ and this library adheres to Rust's notion of
- `zcash_proofs::sapling::SaplingVerificationContext: Default`
### Changed
- MSRV is now 1.47.0.
- `zcash_proofs::load_parameters` now returns `ZcashParameters`.
## [0.4.0] - 2020-09-09