Skip to content

Commit

Permalink
Reintroduce public reexports with deprecation annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Dec 20, 2024
1 parent 9a175cf commit 426b85b
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 45 deletions.
3 changes: 3 additions & 0 deletions components/zcash_address/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this library adheres to Rust's notion of

## [Unreleased]

### Deprecated
- `zcash_address::Network` (use `zcash_protocol::consensus::NetworkType` instead).

## [0.6.2] - 2024-12-13
### Fixed
- Migrated to `f4jumble 0.1.1` to fix `no-std` support.
Expand Down
10 changes: 7 additions & 3 deletions components/zcash_address/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ extern crate alloc;
#[cfg(feature = "std")]
extern crate std;

use alloc::string::String;

mod convert;
mod encoding;
mod kind;
Expand All @@ -151,8 +149,14 @@ pub use convert::{
};
pub use encoding::ParseError;
pub use kind::unified;

use alloc::string::String;

use kind::unified::Receiver;
//pub use zcash_protocol::consensus::NetworkType as Network;

#[deprecated(note = "use ::zcash_protocol::consensus::NetworkType instead")]
pub use zcash_protocol::consensus::NetworkType as Network;

use zcash_protocol::{consensus::NetworkType, PoolType};

/// A Zcash address.
Expand Down
8 changes: 8 additions & 0 deletions zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ and this library adheres to Rust's notion of
### Changed
- Migrated to `nonempty 0.11`

### Deprecated
- `zcash_client_backend::address` (use `zcash_keys::address` instead)
- `zcash_client_backend::encoding` (use `zcash_keys::encoding` instead)
- `zcash_client_backend::keys` (use `zcash_keys::keys` instead)
- `zcash_client_backend::zip321` (use the `zip321` crate instead)
- `zcash_client_backend::PoolType` (use `zcash_protocol::PoolType` instead)
- `zcash_client_backend::ShieldedProtocol` (use `zcash_protocol::ShieldedProtocol` instead)

## [0.16.0] - 2024-12-16

### Added
Expand Down
18 changes: 13 additions & 5 deletions zcash_client_backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,14 @@
// Temporary until we have addressed all Result<T, ()> cases.
#![allow(clippy::result_unit_err)]

//pub use zcash_keys::address;
pub mod data_api;
mod decrypt;
//pub use zcash_keys::encoding;
pub mod fees;
//pub use zcash_keys::keys;
pub mod proposal;
pub mod proto;
pub mod scan;
pub mod scanning;
pub mod wallet;
//pub use zip321;

#[cfg(feature = "sync")]
pub mod sync;
Expand All @@ -84,7 +80,19 @@ pub mod serialization;
pub mod tor;

pub use decrypt::{decrypt_transaction, DecryptedOutput, TransferType};
//pub use zcash_protocol::{PoolType, ShieldedProtocol};

#[deprecated(note = "This module is deprecated; use `::zcash_keys::address` instead.")]
pub use zcash_keys::address;
#[deprecated(note = "This module is deprecated; use `::zcash_keys::encoding` instead.")]
pub use zcash_keys::encoding;
#[deprecated(note = "This module is deprecated; use `::zcash_keys::keys` instead.")]
pub use zcash_keys::keys;
#[deprecated(note = "use ::zcash_protocol::PoolType instead")]
pub use zcash_protocol::PoolType;
#[deprecated(note = "use ::zcash_protocol::ShieldedProtocol instead")]
pub use zcash_protocol::ShieldedProtocol;
#[deprecated(note = "This module is deprecated; use the `zip321` crate instead.")]
pub use zip321;

#[cfg(test)]
#[macro_use]
Expand Down
17 changes: 17 additions & 0 deletions zcash_primitives/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ and this library adheres to Rust's notion of
### Changed
- Migrated to `nonempty 0.11`

### Deprecated
- `zcash_primitives::consensus` (use `zcash_protocol::consensus` instead)
- `zcash_primitives::constants` (use `zcash_protocol::constants` instead)
- `zcash_primitives::memo` (use `zcash_protocol::memo` instead)
- `zcash_primitives::zip32` (use the `zip32` crate instead)
- `zcash_primitives::legacy` (use the `zcash_transparent` crate instead)
- `zcash_primitives::transaction::components::Amount` (use `zcash_protocol::value::ZatBalance` instead)
- `zcash_primitives::transaction::components::amount`:
- `BalanceError` (use `zcash_protocol::value::BalanceError` instead)
- `Amount` (use `zcash_protocol::value::ZatBalance` instead)
- `NonNegativeAmount` (use `zcash_protocol::value::Zatoshis` instead)
- `COIN` (use `zcash_protocol::value::COIN` instead)
- module `testing` (use `zcash_protocol::value::testing` instead)
- `arb_positive_amount` (use `zcash_protocol::value::testing::arb_positive_zat_balance` instead.)
- `arb_amount` (use `zcash_protocol::value::testing::arb_zat_balance` instead.)
- `arb_nonnegative_amount` (use `::zcash_protocol::value::testing::arb_zatoshis` instead.)

## [0.21.0] - 2024-12-16

### Added
Expand Down
27 changes: 16 additions & 11 deletions zcash_primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@
#![allow(clippy::single_component_path_imports)]

pub mod block;
//pub use zcash_protocol::consensus;
//pub use zcash_protocol::constants;
//pub use zcash_protocol::memo;
pub mod merkle_tree;
pub mod transaction;
//pub use zip32;
#[cfg(zcash_unstable = "zfuture")]
pub mod extensions;
pub mod merkle_tree;
pub mod transaction;

//pub mod legacy {
// pub use transparent::address::*;
// #[cfg(feature = "transparent-inputs")]
// pub use transparent::keys;
//}
#[deprecated(note = "This module is deprecated; use `::zcash_protocol::consensus` instead.")]
pub use zcash_protocol::consensus;
#[deprecated(note = "This module is deprecated; use `::zcash_protocol::constants` instead.")]
pub use zcash_protocol::constants;
#[deprecated(note = "This module is deprecated; use `::zcash_protocol::memo` instead.")]
pub use zcash_protocol::memo;
#[deprecated(note = "This module is deprecated; use the `zip32` crate instead.")]
pub use zip32;
#[deprecated(note = "This module is deprecated; use the `zcash_transparent` crate instead.")]
pub mod legacy {
pub use transparent::address::*;
#[cfg(feature = "transparent-inputs")]
pub use transparent::keys;
}
81 changes: 56 additions & 25 deletions zcash_primitives/src/transaction/components.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,66 @@
//! Structs representing the components within Zcash transactions.
//pub mod amount {
// pub use zcash_protocol::value::{
// BalanceError, ZatBalance as Amount, Zatoshis as NonNegativeAmount, COIN,
// };
//
// #[cfg(any(test, feature = "test-dependencies"))]
// pub mod testing {
// pub use zcash_protocol::value::testing::{
// arb_positive_zat_balance as arb_positive_amount, arb_zat_balance as arb_amount,
// arb_zatoshis as arb_nonnegative_amount,
// };
// }
//}
pub mod orchard;
pub mod sapling;
pub mod sprout;
#[cfg(zcash_unstable = "zfuture")]
pub mod tze;

//pub mod transparent {
// pub use transparent::builder;
// pub use transparent::bundle::*;
// pub use transparent::pczt;
//}

pub use self::{
// amount::Amount,
sprout::JsDescription,
// transparent::{OutPoint, TxIn, TxOut},
};
//pub use crate::sapling::bundle::{OutputDescription, SpendDescription};
pub use self::sprout::JsDescription;

#[deprecated(note = "This module is deprecated; use `::zcash_protocol::value` instead.")]
pub mod amount {
#[deprecated(note = "Use `::zcash_protocol::value::BalanceError` instead.")]
pub use zcash_protocol::value::BalanceError;
#[deprecated(note = "Use `::zcash_protocol::value::ZatBalance` instead.")]
pub use zcash_protocol::value::ZatBalance as Amount;
#[deprecated(note = "Use `::zcash_protocol::value::Zatoshis` instead.")]
pub use zcash_protocol::value::Zatoshis as NonNegativeAmount;
#[deprecated(note = "Use `::zcash_protocol::value::COIN` instead.")]
pub use zcash_protocol::value::COIN;

#[cfg(any(test, feature = "test-dependencies"))]
#[deprecated(note = "Use `::zcash_protocol::value::testing` instead.")]
pub mod testing {
#[deprecated(
note = "Use `::zcash_protocol::value::testing::arb_positive_zat_balance` instead."
)]
pub use zcash_protocol::value::testing::arb_positive_zat_balance as arb_positive_amount;
#[deprecated(
note = "Use `::zcash_protocol::value::testing::arb_zat_balance` instead."
)]
pub use zcash_protocol::value::testing::arb_zat_balance as arb_amount;
#[deprecated(note = "Use `::zcash_protocol::value::testing::arb_zatoshis` instead.")]
pub use zcash_protocol::value::testing::arb_zatoshis as arb_nonnegative_amount;
}
}

#[deprecated(note = "This module is deprecated; use the `zcash_transparent` crate instead.")]
pub mod transparent {
#[deprecated(
note = "This module is deprecated; use `::zcash_transparent::builder` instead."
)]
pub use ::transparent::builder;
#[deprecated(
note = "This module is deprecated; use `::zcash_transparent::bundle` instead."
)]
pub use ::transparent::bundle::*;
#[deprecated(note = "This module is deprecated; use `::zcash_transparent::pczt` instead.")]
pub use ::transparent::pczt;
}

#[deprecated(note = "use `::zcash_transparent::bundle::OutPoint` instead.")]
pub use ::transparent::bundle::OutPoint;
#[deprecated(note = "use `::zcash_transparent::bundle::TxIn` instead.")]
pub use ::transparent::bundle::TxIn;
#[deprecated(note = "use `::zcash_transparent::bundle::TxIn` instead.")]
pub use ::transparent::bundle::TxOut;
#[deprecated(note = "use `::zcash_protocol::value::ZatBalance` instead.")]
pub use zcash_protocol::value::ZatBalance as Amount;

#[deprecated(
note = "Use `::sapling_crypto::bundle::{OutputDescription, SpendDescription}` instead."
)]
pub use ::sapling::bundle::{OutputDescription, SpendDescription};

#[cfg(zcash_unstable = "zfuture")]
pub use self::tze::{TzeIn, TzeOut};
Expand Down
3 changes: 2 additions & 1 deletion zcash_primitives/src/transaction/sighash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use ::sapling::{self, bundle::GrothProofBytes};
#[cfg(zcash_unstable = "zfuture")]
use {crate::extensions::transparent::Precondition, zcash_protocol::value::Zatoshis};

//pub use transparent::sighash::*;
#[deprecated(note = "use `::zcash_transparent::sighash` instead.")]
pub use transparent::sighash::*;

pub enum SignableInput<'a> {
Shielded,
Expand Down

0 comments on commit 426b85b

Please sign in to comment.