diff --git a/components/zcash_protocol/src/consensus.rs b/components/zcash_protocol/src/consensus.rs index 11a70ec327..c060b68f87 100644 --- a/components/zcash_protocol/src/consensus.rs +++ b/components/zcash_protocol/src/consensus.rs @@ -485,7 +485,7 @@ pub const ZIP212_GRACE_PERIOD: u32 = 32256; /// /// See [ZIP 200](https://zips.z.cash/zip-0200) for more details. /// -/// [`signature_hash`]: crate::transaction::sighash::signature_hash +/// [`signature_hash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/transaction/sighash/fn.signature_hash.html #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum BranchId { /// The consensus rules at the launch of Zcash. diff --git a/components/zcash_protocol/src/constants/mainnet.rs b/components/zcash_protocol/src/constants/mainnet.rs index 3b099e1389..bd31a895eb 100644 --- a/components/zcash_protocol/src/constants/mainnet.rs +++ b/components/zcash_protocol/src/constants/mainnet.rs @@ -9,7 +9,7 @@ pub const COIN_TYPE: u32 = 133; /// /// Defined in [ZIP 32]. /// -/// [`ExtendedSpendingKey`]: crate::sapling::zip32::ExtendedSpendingKey +/// [`ExtendedSpendingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedSpendingKey.html /// [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`]: crate::sapling::zip32::ExtendedFullViewingKey +/// [`ExtendedFullViewingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedFullViewingKey.html# /// [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`]: crate::sapling::PaymentAddress +/// [`PaymentAddress`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/struct.PaymentAddress.html /// [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 [`PublicKeyHash`]. /// -/// [`PublicKeyHash`]: crate::legacy::TransparentAddress::PublicKeyHash +/// [`PublicKeyHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xb8]; /// The prefix for a Base58Check-encoded mainnet [`ScriptHash`]. /// -/// [`ScriptHash`]: crate::legacy::TransparentAddress::ScriptHash +/// [`ScriptHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xbd]; diff --git a/components/zcash_protocol/src/constants/regtest.rs b/components/zcash_protocol/src/constants/regtest.rs index c460ccbd41..7ae37dec53 100644 --- a/components/zcash_protocol/src/constants/regtest.rs +++ b/components/zcash_protocol/src/constants/regtest.rs @@ -13,7 +13,7 @@ pub const COIN_TYPE: u32 = 1; /// /// It is defined in [the `zcashd` codebase]. /// -/// [`ExtendedSpendingKey`]: crate::sapling::zip32::ExtendedSpendingKey +/// [`ExtendedSpendingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedSpendingKey.html /// [the `zcashd` codebase]: pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-regtest"; @@ -21,7 +21,7 @@ pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-regtest /// /// It is defined in [the `zcashd` codebase]. /// -/// [`ExtendedFullViewingKey`]: crate::sapling::zip32::ExtendedFullViewingKey +/// [`ExtendedFullViewingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedFullViewingKey.html# /// [the `zcashd` codebase]: pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewregtestsapling"; @@ -29,18 +29,18 @@ pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewregtestsapling"; /// /// It is defined in [the `zcashd` codebase]. /// -/// [`PaymentAddress`]: crate::sapling::PaymentAddress +/// [`PaymentAddress`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/struct.PaymentAddress.html /// [the `zcashd` codebase]: pub const HRP_SAPLING_PAYMENT_ADDRESS: &str = "zregtestsapling"; /// The prefix for a Base58Check-encoded regtest transparent [`PublicKeyHash`]. /// Same as the testnet prefix. /// -/// [`PublicKeyHash`]: crate::legacy::TransparentAddress::PublicKeyHash +/// [`PublicKeyHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1d, 0x25]; /// The prefix for a Base58Check-encoded regtest transparent [`ScriptHash`]. /// Same as the testnet prefix. /// -/// [`ScriptHash`]: crate::legacy::TransparentAddress::ScriptHash +/// [`ScriptHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xba]; diff --git a/components/zcash_protocol/src/constants/testnet.rs b/components/zcash_protocol/src/constants/testnet.rs index b61e188c36..dba86bb9c7 100644 --- a/components/zcash_protocol/src/constants/testnet.rs +++ b/components/zcash_protocol/src/constants/testnet.rs @@ -9,7 +9,7 @@ pub const COIN_TYPE: u32 = 1; /// /// Defined in [ZIP 32]. /// -/// [`ExtendedSpendingKey`]: crate::sapling::zip32::ExtendedSpendingKey +/// [`ExtendedSpendingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedSpendingKey.html /// [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`]: crate::sapling::zip32::ExtendedFullViewingKey +/// [`ExtendedFullViewingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedFullViewingKey.html# /// [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`]: crate::sapling::PaymentAddress +/// [`PaymentAddress`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/struct.PaymentAddress.html /// [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 transparent [`PublicKeyHash`]. /// -/// [`PublicKeyHash`]: crate::legacy::TransparentAddress::PublicKeyHash +/// [`PublicKeyHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1d, 0x25]; /// The prefix for a Base58Check-encoded testnet transparent [`ScriptHash`]. /// -/// [`ScriptHash`]: crate::legacy::TransparentAddress::ScriptHash +/// [`ScriptHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xba]; diff --git a/components/zcash_protocol/src/value.rs b/components/zcash_protocol/src/value.rs index 34070a8a8e..65376fa8e0 100644 --- a/components/zcash_protocol/src/value.rs +++ b/components/zcash_protocol/src/value.rs @@ -19,7 +19,7 @@ pub const MAX_BALANCE: i64 = MAX_MONEY as i64; /// particular, a [`Transaction`] containing serialized invalid ZatBalances will be rejected /// by the network consensus rules. /// -/// [`Transaction`]: crate::transaction::Transaction +/// [`Transaction`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/transaction/struct.Transaction.html #[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Eq, Ord)] pub struct ZatBalance(i64); diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index f3c235d279..61b2785c2e 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -126,6 +126,7 @@ orchard = ["dep:orchard", "zcash_keys/orchard"] test-dependencies = [ "dep:proptest", "orchard?/test-dependencies", + "zcash_keys/test-dependencies", "zcash_primitives/test-dependencies", "incrementalmerkletree/test-dependencies", ] diff --git a/zcash_client_backend/src/lib.rs b/zcash_client_backend/src/lib.rs index 94f2c4eaef..becae938fc 100644 --- a/zcash_client_backend/src/lib.rs +++ b/zcash_client_backend/src/lib.rs @@ -84,10 +84,10 @@ pub use decrypt::{decrypt_transaction, DecryptedOutput, TransferType}; #[macro_use] extern crate assert_matches; -#[cfg(all(feature = "orchard", not(zcash_unstable = "orchard")))] -core::compile_error!( - "The `orchard` feature flag requires the `zcash_unstable=\"orchard\"` RUSTFLAG." -); +// #[cfg(all(feature = "orchard", not(zcash_unstable = "orchard")))] +// core::compile_error!( +// "The `orchard` feature flag requires the `zcash_unstable=\"orchard\"` RUSTFLAG." +// ); /// A shielded transfer protocol known to the wallet. #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] diff --git a/zcash_client_backend/src/zip321.rs b/zcash_client_backend/src/zip321.rs index 2607c8c325..f3d859a2cd 100644 --- a/zcash_client_backend/src/zip321.rs +++ b/zcash_client_backend/src/zip321.rs @@ -414,7 +414,7 @@ mod render { format!("address{}={}", param_index(idx), addr.encode(params)) } - /// Converts an [`Amount`] value to a correctly formatted decimal ZEC + /// Converts an [`NonNegativeAmount`] value to a correctly formatted decimal ZEC /// value for inclusion in a ZIP 321 URI. pub fn amount_str(amount: NonNegativeAmount) -> Option { if amount.is_positive() {