segwit: revert wrong removal

This commit is contained in:
Svyatoslav Nikolsky 2017-08-21 12:11:38 +03:00
parent 4c432858cf
commit 4bc63d6081
2 changed files with 17 additions and 1 deletions

View File

@ -216,7 +216,6 @@ impl ConsensusFork {
mod tests {
use super::super::Magic;
use super::{ConsensusParams, ConsensusFork};
//use deployments::tests::DummyDeployments;
#[test]
fn test_consensus_params_bip34_height() {
@ -253,6 +252,22 @@ mod tests {
assert_eq!(ConsensusParams::new(Magic::Regtest, ConsensusFork::NoFork).miner_confirmation_window, 144);
}
#[test]
fn test_consensus_fork_min_block_size() {
assert_eq!(ConsensusFork::NoFork.min_block_size(0), 0);
assert_eq!(ConsensusFork::SegWit2x(100).min_block_size(0), 0);
assert_eq!(ConsensusFork::SegWit2x(100).min_block_size(100), 0);
assert_eq!(ConsensusFork::BitcoinCash(100).min_block_size(0), 0);
assert_eq!(ConsensusFork::BitcoinCash(100).min_block_size(100), 1_000_001);
}
#[test]
fn test_consensus_fork_max_transaction_size() {
assert_eq!(ConsensusFork::NoFork.max_transaction_size(0), 1_000_000);
assert_eq!(ConsensusFork::SegWit2x(100).max_transaction_size(0), 1_000_000);
assert_eq!(ConsensusFork::BitcoinCash(100).max_transaction_size(0), 1_000_000);
}
#[test]
fn test_consensus_fork_max_block_sigops() {
assert_eq!(ConsensusFork::NoFork.max_block_sigops(0, 1_000_000), 20_000);

View File

@ -20,3 +20,4 @@ impl Deployment {
(version & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS && (version & (1 << self.bit)) != 0
}
}