Skip to content

Commit

Permalink
WIP: tests that are probably wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Apr 11, 2022
1 parent 51e304b commit 7cb552f
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions zebra-state/src/service/non_finalized_state/tests/vectors.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
//! Fixed test vectors for the non-finalized state.
use std::sync::Arc;
use std::{
collections::{HashMap, HashSet},
sync::Arc,
};

use zebra_chain::{
amount::NonNegative,
amount::{Amount, NegativeAllowed, NonNegative},
block::Block,
history_tree::NonEmptyHistoryTree,
parameters::{Network, NetworkUpgrade},
serialization::ZcashDeserializeInto,
value_balance::ValueBalance,
};

use zebra_test::prelude::*;

use crate::{
Expand Down Expand Up @@ -54,6 +58,35 @@ fn construct_single() -> Result<()> {

assert_eq!(1, chain.blocks.len());

for (address, transfers) in chain.partial_transparent_transfers {
assert_eq!(
transfers.balance(),
Amount::<NegativeAllowed>::try_from(13520652).unwrap(),
"invalid partial balance for: {}",
address,
);

assert_eq!(
transfers.tx_ids(),
Default::default(),
"invalid partial transactions for: {}",
address,
);

assert_eq!(
transfers.created_utxos(),
&HashMap::new(),
"invalid partial unspent outputs for: {}",
address,
);
assert_eq!(
transfers.spent_utxos(),
&HashSet::new(),
"invalid partial spent outputs for: {}",
address,
);
}

Ok(())
}

Expand Down

0 comments on commit 7cb552f

Please sign in to comment.