Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Aug 3, 2022
1 parent bf7b9aa commit 2cadfd0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
6 changes: 4 additions & 2 deletions base_layer/core/src/base_node/sync/rpc/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ mod sync_utxos {
let (_, chain) = create_main_chain(&db, block_specs!(["A->GB"], ["B->A"]));

let block = chain.get("B").unwrap();
let total_outputs = block.block().header.output_mmr_size;
let start = total_outputs - 2;
let msg = SyncUtxosRequest {
start: 3500,
start,
end_header_hash: block.hash().clone(),
include_pruned_utxos: true,
include_deleted_bitmaps: false,
Expand All @@ -170,6 +172,6 @@ mod sync_utxos {
.collect::<Vec<_>>()
.await;

assert!(utxo_indexes.iter().all(|index| (3500..=4002).contains(index)));
assert!(utxo_indexes.iter().all(|index| (start..=start + 2).contains(index)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ mod fetch_total_size_stats {
let stats = db.fetch_total_size_stats().unwrap();
assert_eq!(
stats.sizes().iter().find(|s| s.name == "utxos_db").unwrap().num_entries,
4003
3
);
}
}
Expand Down Expand Up @@ -580,7 +580,7 @@ mod fetch_header_containing_utxo_mmr {
fn it_returns_genesis() {
let db = setup();
let genesis = db.fetch_block(0).unwrap();
assert_eq!(genesis.block().body.outputs().len(), 4001);
assert!(genesis.block().body.outputs().len() >= 1);
let mut mmr_position = 0;
genesis.block().body.outputs().iter().for_each(|_| {
let header = db.fetch_header_containing_utxo_mmr(mmr_position).unwrap();
Expand Down Expand Up @@ -620,7 +620,7 @@ mod fetch_header_containing_kernel_mmr {
fn it_returns_genesis() {
let db = setup();
let genesis = db.fetch_block(0).unwrap();
assert_eq!(genesis.block().body.kernels().len(), 2);
assert_eq!(genesis.block().body.kernels().len(), 1);
let mut mmr_position = 0;
genesis.block().body.kernels().iter().for_each(|_| {
let header = db.fetch_header_containing_kernel_mmr(mmr_position).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/consensus/consensus_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ impl ConsensusConstants {
vec![ConsensusConstants {
effective_from_height: 0,
coinbase_lock_height: 2,
blockchain_version: 1,
blockchain_version: 2,
valid_blockchain_version_range: 0..=3,
future_time_limit: 540,
difficulty_block_window,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl TransactionOutput {
encrypted_value: &EncryptedValue,
minimum_value_promise: MicroTari,
) -> [u8; 32] {
let common = DomainSeparatedConsensusHasher::<TransactionHashDomain>::new("metadata_signature_challenge")
let common = DomainSeparatedConsensusHasher::<TransactionHashDomain>::new("metadata_signature")
.chain(public_commitment_nonce)
.chain(script)
.chain(features)
Expand Down
3 changes: 1 addition & 2 deletions base_layer/core/tests/node_comms_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ async fn inbound_fetch_blocks() {
#[allow(clippy::too_many_lines)]
async fn inbound_fetch_blocks_before_horizon_height() {
let factories = CryptoFactories::default();
let network = Network::LocalNet;
let consensus_manager = ConsensusManager::builder(network).build();
let consensus_manager = ConsensusManager::builder(Network::Dibbler).build();
let block0 = consensus_manager.get_genesis_block();
let validators = Validators::new(
MockValidator::new(true),
Expand Down

0 comments on commit 2cadfd0

Please sign in to comment.