Skip to content

Commit

Permalink
Fix fee serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Oct 28, 2022
1 parent 7f61223 commit 3e5e15f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions zebra-chain/src/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use std::{
cmp::Ordering,
convert::{TryFrom, TryInto},
hash::{Hash, Hasher},
marker::PhantomData,
ops::RangeInclusive,
Expand All @@ -28,7 +27,8 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
/// A runtime validated type for representing amounts of zatoshis
#[derive(Clone, Copy, Serialize, Deserialize)]
#[serde(try_from = "i64")]
#[serde(bound = "C: Constraint")]
#[serde(into = "i64")]
#[serde(bound = "C: Constraint + Clone")]
pub struct Amount<C = NegativeAllowed>(
/// The inner amount value.
i64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ pub struct GetBlockTemplate {
/// Add documentation.
#[serde(rename = "previousblockhash")]
pub previous_block_hash: GetBlockHash,

/// Add documentation.
#[serde(rename = "blockcommitmentshash")]
#[serde(with = "hex")]
pub block_commitments_hash: ChainHistoryBlockTxAuthCommitmentHash,

/// Add documentation.
#[serde(rename = "lightclientroothash")]
#[serde(with = "hex")]
pub light_client_root_hash: ChainHistoryBlockTxAuthCommitmentHash,

/// Add documentation.
#[serde(rename = "finalsaplingroothash")]
#[serde(with = "hex")]
pub final_sapling_root_hash: ChainHistoryBlockTxAuthCommitmentHash,

/// Add documentation.
#[serde(rename = "defaultroots")]
pub default_roots: DefaultRoots,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use zebra_chain::{

/// Transaction data and fields needed to generate blocks using the `getblocktemplate` RPC.
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(bound = "FeeConstraint: amount::Constraint")]
#[serde(bound = "FeeConstraint: amount::Constraint + Clone")]
pub struct TransactionTemplate<FeeConstraint>
where
FeeConstraint: amount::Constraint,
FeeConstraint: amount::Constraint + Clone,
{
/// The hex-encoded serialized data for this transaction.
#[serde(with = "hex")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ expression: block_template
"hash": "0000000000000000000000000000000000000000000000000000000000000000",
"authdigest": "0000000000000000000000000000000000000000000000000000000000000000",
"depends": [],
"fee": [
0
],
"fee": 0,
"sigops": 0,
"required": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ expression: block_template
"hash": "0000000000000000000000000000000000000000000000000000000000000000",
"authdigest": "0000000000000000000000000000000000000000000000000000000000000000",
"depends": [],
"fee": [
0
],
"fee": 0,
"sigops": 0,
"required": true
},
Expand Down

0 comments on commit 3e5e15f

Please sign in to comment.