Skip to content

Commit 8d302bb

Browse files
committed
Updates snapshots, removes unnecessary FIXMEs, fixes issues with bad merge conflict resolution
1 parent b8b4efe commit 8d302bb

File tree

5 files changed

+18
-42
lines changed

5 files changed

+18
-42
lines changed

zebra-chain/src/parameters/network/testnet.rs

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -118,35 +118,24 @@ impl From<&BTreeMap<Height, NetworkUpgrade>> for ConfiguredActivationHeights {
118118
let mut configured_activation_heights = ConfiguredActivationHeights::default();
119119

120120
for (height, network_upgrade) in activation_heights.iter() {
121-
match network_upgrade {
121+
let field = match network_upgrade {
122122
NetworkUpgrade::BeforeOverwinter => {
123-
configured_activation_heights.before_overwinter = Some(height.0);
124-
}
125-
NetworkUpgrade::Overwinter => {
126-
configured_activation_heights.overwinter = Some(height.0);
127-
}
128-
NetworkUpgrade::Sapling => {
129-
configured_activation_heights.sapling = Some(height.0);
130-
}
131-
NetworkUpgrade::Blossom => {
132-
configured_activation_heights.blossom = Some(height.0);
133-
}
134-
NetworkUpgrade::Heartwood => {
135-
configured_activation_heights.heartwood = Some(height.0);
136-
}
137-
NetworkUpgrade::Canopy => {
138-
configured_activation_heights.canopy = Some(height.0);
139-
}
140-
NetworkUpgrade::Nu5 => {
141-
configured_activation_heights.nu5 = Some(height.0);
142-
}
143-
NetworkUpgrade::Nu6 => {
144-
configured_activation_heights.nu6 = Some(height.0);
123+
&mut configured_activation_heights.before_overwinter
145124
}
125+
NetworkUpgrade::Overwinter => &mut configured_activation_heights.overwinter,
126+
NetworkUpgrade::Sapling => &mut configured_activation_heights.sapling,
127+
NetworkUpgrade::Blossom => &mut configured_activation_heights.blossom,
128+
NetworkUpgrade::Heartwood => &mut configured_activation_heights.heartwood,
129+
NetworkUpgrade::Canopy => &mut configured_activation_heights.canopy,
130+
NetworkUpgrade::Nu5 => &mut configured_activation_heights.nu5,
131+
NetworkUpgrade::Nu6 => &mut configured_activation_heights.nu6,
132+
NetworkUpgrade::Nu7 => &mut configured_activation_heights.nu7,
146133
NetworkUpgrade::Genesis => {
147134
continue;
148135
}
149-
}
136+
};
137+
138+
*field = Some(height.0)
150139
}
151140

152141
configured_activation_heights
@@ -890,7 +879,6 @@ impl Network {
890879

891880
/// Returns post-Canopy funding streams for this network at the provided height
892881
pub fn funding_streams(&self, height: Height) -> &FundingStreams {
893-
// FIXME: Would this work after Nu7 activation?
894882
if NetworkUpgrade::current(self, height) < NetworkUpgrade::Nu6 {
895883
self.pre_nu6_funding_streams()
896884
} else {

zebra-consensus/src/transaction/tests.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use zebra_chain::{
1717
amount::{Amount, NonNegative},
1818
block::{self, Block, Height},
1919
orchard::{Action, AuthorizedAction, Flags},
20-
parameters::{Network, NetworkUpgrade},
20+
parameters::{testnet::ConfiguredActivationHeights, Network, NetworkUpgrade},
2121
primitives::{ed25519, x25519, Groth16Proof},
2222
sapling,
2323
serialization::{DateTime32, ZcashDeserialize, ZcashDeserializeInto},
@@ -1007,7 +1007,10 @@ async fn mempool_request_with_immature_spend_is_rejected() {
10071007
async fn mempool_request_with_transparent_coinbase_spend_is_accepted_on_regtest() {
10081008
let _init_guard = zebra_test::init();
10091009

1010-
let network = Network::new_regtest(None, Some(1_000));
1010+
let network = Network::new_regtest(ConfiguredActivationHeights {
1011+
nu6: Some(1_000),
1012+
..Default::default()
1013+
});
10111014
let mut state: MockService<_, _, _, _> = MockService::build().for_unit_tests();
10121015
let verifier = Verifier::new_for_tests(&network, state.clone());
10131016

zebra-rpc/src/methods/tests/snapshots/get_blockchain_info@mainnet_10.snap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
source: zebra-rpc/src/methods/tests/snapshot.rs
3-
assertion_line: 562
43
expression: info
54
---
65
{
@@ -87,11 +86,6 @@ expression: info
8786
"name": "NU6",
8887
"activationheight": 2726400,
8988
"status": "pending"
90-
},
91-
"77190ad8": {
92-
"name": "NU7",
93-
"activationheight": 3111000,
94-
"status": "pending"
9589
}
9690
},
9791
"consensus": {

zebra-rpc/src/methods/tests/snapshots/get_blockchain_info@testnet_10.snap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
source: zebra-rpc/src/methods/tests/snapshot.rs
3-
assertion_line: 562
43
expression: info
54
---
65
{
@@ -87,11 +86,6 @@ expression: info
8786
"name": "NU6",
8887
"activationheight": 2976000,
8988
"status": "pending"
90-
},
91-
"77190ad8": {
92-
"name": "NU7",
93-
"activationheight": 3222000,
94-
"status": "pending"
9589
}
9690
},
9791
"consensus": {

zebrad/tests/acceptance.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,6 @@ async fn nu6_funding_streams_and_coinbase_balance() -> Result<()> {
33773377
panic!("this getblocktemplate call without parameters should return the `TemplateMode` variant of the response")
33783378
};
33793379

3380-
// FIXME: Would this work after Nu7 activation?
33813380
let proposal_block = proposal_block_from_template(&block_template, None, NetworkUpgrade::Nu6)?;
33823381
let hex_proposal_block = HexData(proposal_block.zcash_serialize_to_vec()?);
33833382

@@ -3486,7 +3485,6 @@ async fn nu6_funding_streams_and_coinbase_balance() -> Result<()> {
34863485
..(*block_template)
34873486
};
34883487

3489-
// FIXME: Would this work after Nu7 activation?
34903488
let proposal_block = proposal_block_from_template(&block_template, None, NetworkUpgrade::Nu6)?;
34913489

34923490
// Submit the invalid block with an excessive coinbase output value
@@ -3530,7 +3528,6 @@ async fn nu6_funding_streams_and_coinbase_balance() -> Result<()> {
35303528
..block_template
35313529
};
35323530

3533-
// FIXME: Would this work after Nu7 activation?
35343531
let proposal_block = proposal_block_from_template(&block_template, None, NetworkUpgrade::Nu6)?;
35353532

35363533
// Submit the invalid block with an excessive coinbase input value

0 commit comments

Comments
 (0)