Skip to content

Commit

Permalink
Fixes a panic (#8928)
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 authored Oct 10, 2024
1 parent f2e7bc9 commit fea9f46
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions zebra-chain/src/parameters/network/testnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ pub struct ConfiguredFundingStreams {
}

impl ConfiguredFundingStreams {
/// Returns an empty [`ConfiguredFundingStreams`].
fn empty() -> Self {
Self {
height_range: None,
recipients: Some(Vec::new()),
}
}

/// Converts a [`ConfiguredFundingStreams`] to a [`FundingStreams`], using the provided default values
/// if `height_range` or `recipients` are None.
fn convert_with_default(
Expand Down Expand Up @@ -601,10 +609,10 @@ impl Parameters {
.with_halving_interval(PRE_BLOSSOM_REGTEST_HALVING_INTERVAL);

// TODO: Always clear funding streams on Regtest once the testnet parameters are being serialized (#8920).
#[cfg(not(any(test, feature = "proptest-impl")))]
// #[cfg(not(any(test, feature = "proptest-impl")))]
let parameters = parameters
.with_pre_nu6_funding_streams(ConfiguredFundingStreams::default())
.with_post_nu6_funding_streams(ConfiguredFundingStreams::default());
.with_pre_nu6_funding_streams(ConfiguredFundingStreams::empty())
.with_post_nu6_funding_streams(ConfiguredFundingStreams::empty());

Self {
network_name: "Regtest".to_string(),
Expand Down

0 comments on commit fea9f46

Please sign in to comment.