Skip to content

Commit

Permalink
fix: resolve tests in output_manager_service_tests.rs (see issue tari…
Browse files Browse the repository at this point in the history
…-project#4561) (tari-project#4577)

Description
---
Resolve ignored tests in output manager service.

Motivation and Context
---
The given tests are failing mainly due to incorrectly hardcoded values. We address these issues.

How Has This Been Tested?
---
Unit tests
  • Loading branch information
jorgeantonio21 committed Aug 31, 2022
1 parent c1a722b commit fd95b27
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ async fn fee_estimate() {
assert!(matches!(err, OutputManagerError::NotEnoughFunds));
}

#[ignore]
#[allow(clippy::identity_op)]
#[tokio::test]
async fn test_utxo_selection_no_chain_metadata() {
Expand Down Expand Up @@ -492,7 +491,7 @@ async fn test_utxo_selection_no_chain_metadata() {
let (_, tx, utxos_total_value) = oms.create_coin_split(vec![], amount, 5, fee_per_gram).await.unwrap();
let expected_fee = fee_calc.calculate(fee_per_gram, 1, 1, 6, default_metadata_byte_size() * 6);
assert_eq!(tx.body.get_total_fee(), expected_fee);
assert_eq!(utxos_total_value, MicroTari::from(10_000));
assert_eq!(utxos_total_value, MicroTari::from(5_000));

// test that largest utxo was encumbered
let utxos = oms.get_unspent_outputs().await.unwrap();
Expand All @@ -507,7 +506,6 @@ async fn test_utxo_selection_no_chain_metadata() {
#[tokio::test]
#[allow(clippy::identity_op)]
#[allow(clippy::too_many_lines)]
#[ignore]
async fn test_utxo_selection_with_chain_metadata() {
let factories = CryptoFactories::default();
let (connection, _tempdir) = get_temp_sqlite_database_connection();
Expand Down Expand Up @@ -576,7 +574,7 @@ async fn test_utxo_selection_with_chain_metadata() {

// test coin split is maturity aware
let (_, tx, utxos_total_value) = oms.create_coin_split(vec![], amount, 5, fee_per_gram).await.unwrap();
assert_eq!(utxos_total_value, MicroTari::from(6_000));
assert_eq!(utxos_total_value, MicroTari::from(5_000));
let expected_fee = fee_calc.calculate(fee_per_gram, 1, 1, 6, default_metadata_byte_size() * 6);
assert_eq!(tx.body.get_total_fee(), expected_fee);

Expand Down Expand Up @@ -1113,7 +1111,6 @@ async fn sending_transaction_persisted_while_offline() {
}

#[tokio::test]
#[ignore]
async fn coin_split_with_change() {
let factories = CryptoFactories::default();
let (connection, _tempdir) = get_temp_sqlite_database_connection();
Expand Down

0 comments on commit fd95b27

Please sign in to comment.