Use <P: consensus::Parameters> type for Builder impl

This commit is contained in:
therealyingtong 2020-08-06 17:33:33 +08:00
parent 0f8f1b3f5d
commit 7cee29bbcc
No known key found for this signature in database
GPG Key ID: 179F32A1503D607E
1 changed files with 1 additions and 17 deletions

View File

@ -14,7 +14,6 @@ use std::marker::PhantomData;
use crate::{
consensus,
consensus::{MainNetwork, TestNetwork},
keys::OutgoingViewingKey,
legacy::TransparentAddress,
merkle_tree::MerklePath,
@ -319,22 +318,7 @@ pub struct Builder<P: consensus::Parameters, R: RngCore + CryptoRng> {
phantom: PhantomData<P>,
}
impl Builder<MainNetwork, OsRng> {
/// Creates a new `Builder` targeted for inclusion in the block with the given height,
/// using default values for general transaction fields and the default OS random.
///
/// # Default values
///
/// The expiry height will be set to the given height plus the default transaction
/// expiry delta (20 blocks).
///
/// The fee will be set to the default fee (0.0001 ZEC).
pub fn new(height: u32) -> Self {
Builder::new_with_rng(height, OsRng)
}
}
impl Builder<TestNetwork, OsRng> {
impl<P: consensus::Parameters> Builder<P, OsRng> {
/// Creates a new `Builder` targeted for inclusion in the block with the given height,
/// using default values for general transaction fields and the default OS random.
///