Skip to content

Commit

Permalink
Remove serde on Proposal e.t. al as per PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Oct 11, 2024
1 parent 9ffef93 commit dcc1d82
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions zcash_client_backend/src/fees.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::fmt;

use serde::{Deserialize, Serialize};
use zcash_primitives::{
consensus::{self, BlockHeight},
memo::MemoBytes,
Expand All @@ -25,10 +24,10 @@ pub mod zip317;
/// `ChangeValue` represents either a proposed change output to a shielded pool
/// (with an optional change memo), or if the "transparent-inputs" feature is
/// enabled, an ephemeral output to the transparent pool.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ChangeValue(ChangeValueInner);

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq)]
enum ChangeValueInner {
Shielded {
protocol: ShieldedProtocol,
Expand Down Expand Up @@ -115,7 +114,7 @@ impl ChangeValue {
/// The amount of change and fees required to make a transaction's inputs and
/// outputs balance under a specific fee rule, as computed by a particular
/// [`ChangeStrategy`] that is aware of that rule.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TransactionBalance {
proposed_change: Vec<ChangeValue>,
fee_required: NonNegativeAmount,
Expand Down
5 changes: 2 additions & 3 deletions zcash_client_backend/src/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::{
};

use nonempty::NonEmpty;
use serde::{Deserialize, Serialize};
use zcash_primitives::{
consensus::BlockHeight,
transaction::{components::amount::NonNegativeAmount, TxId},
Expand Down Expand Up @@ -331,14 +330,14 @@ impl<FeeRuleT: Debug, NoteRef> Debug for Proposal<FeeRuleT, NoteRef> {
}

/// A reference to either a payment or change output within a step.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum StepOutputIndex {
Payment(usize),
Change(usize),
}

/// A reference to the output of a step in a proposal.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct StepOutput {
step_index: usize,
output_index: StepOutputIndex,
Expand Down
2 changes: 1 addition & 1 deletion zcash_primitives/src/transaction/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub trait FutureFeeRule: FeeRule {
}

/// An enumeration of the standard fee rules supported by the wallet.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum StandardFeeRule {
#[deprecated(
note = "Using this fee rule violates ZIP 317, and might cause transactions built with it to fail. Use `StandardFeeRule::Zip317` instead."
Expand Down
4 changes: 1 addition & 3 deletions zcash_primitives/src/transaction/fees/zip317.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//! [ZIP 317]: https//zips.z.cash/zip-0317
use core::cmp::max;

use serde::{Deserialize, Serialize};

use crate::{
consensus::{self, BlockHeight},
transaction::{
Expand Down Expand Up @@ -55,7 +53,7 @@ pub const MINIMUM_FEE: NonNegativeAmount = NonNegativeAmount::const_from_u64(10_
///
/// [`FeeRule`]: crate::transaction::fees::FeeRule
/// [ZIP 317]: https//zips.z.cash/zip-0317
#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug)]
pub struct FeeRule {
marginal_fee: NonNegativeAmount,
grace_actions: usize,
Expand Down

0 comments on commit dcc1d82

Please sign in to comment.