Skip to content

Commit

Permalink
expect fee in incoming txs in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra authored and piotr-iohk committed Mar 17, 2023
1 parent 7d4f880 commit c226379
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
20 changes: 10 additions & 10 deletions test/e2e/spec/e2e_shared_spec.rb
Expand Up @@ -196,7 +196,7 @@
# on target wallet
txt = SHELLEY.transactions.get(target_wid, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -308,7 +308,7 @@
# on target wallet
txt = SHELLEY.transactions.get(target_wid, tx_id)
tx_amount(txt, amt * 2)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -421,7 +421,7 @@
# on target wallet
txt = SHELLEY.transactions.get(target_wid, tx_id)
tx_amount(txt, amt_ada)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -534,7 +534,7 @@
# on target wallet
txt = SHELLEY.transactions.get(target_wid, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -676,7 +676,7 @@
# on target wallet
txt = SHELLEY.transactions.get(target_wid, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -779,7 +779,7 @@
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -876,7 +876,7 @@
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt * 2)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -980,7 +980,7 @@
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt_ada)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -1080,7 +1080,7 @@
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -1396,7 +1396,7 @@

# on target wallet
txt = SHARED.transactions.get(@wid_sha, tx_id)
tx_fee(txt, 0)
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down
27 changes: 14 additions & 13 deletions test/e2e/spec/e2e_spec.rb
Expand Up @@ -825,7 +825,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -924,7 +924,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt * 2)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -1027,7 +1027,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt_ada)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -1287,7 +1287,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, expected_fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -1449,7 +1449,7 @@ def script_hash
tx = SHELLEY.transactions.get(@target_id, tx_id)
expect(tx['amount']['quantity']).to be > 0
expect(tx['amount']['quantity']).to be < deposit_returned
tx_fee(tx, 0)
tx_fee(tx, expected_fee)
tx_inputs(tx, present: true)
tx_outputs(tx, present: true)
tx_direction(tx, 'incoming')
Expand Down Expand Up @@ -2572,7 +2572,8 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
# in old tx workflow, only expecting fee to be present because fee calculation is not reliable enough for strong assertions
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -2639,7 +2640,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -2730,7 +2731,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -2797,7 +2798,7 @@ def script_hash
# on target wallet
txt = SHELLEY.transactions.get(@target_id, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -3014,7 +3015,7 @@ def script_hash
tx = SHELLEY.transactions.get(@target_id, quit_tx_id)
expect(tx['amount']['quantity']).to be > 0
expect(tx['amount']['quantity']).to be < deposit
tx_fee(tx, 0)
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(tx, present: true)
tx_outputs(tx, present: true)
tx_direction(tx, 'incoming')
Expand Down Expand Up @@ -3174,7 +3175,7 @@ def test_byron_tx(source_wid, target_wid)
# on target wallet
txt = SHELLEY.transactions.get(target_wid, tx_id)
tx_amount(txt, amt)
tx_fee(txt, 0)
tx_fee(tx, fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -3263,7 +3264,7 @@ def test_byron_assets_tx(source_id, target_id)
# on target wallet
txt = SHELLEY.transactions.get(target_id, tx_id)
tx_amount(txt, amt_ada)
tx_fee(txt, 0)
tx_fee(tx, fee)
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down Expand Up @@ -3529,7 +3530,7 @@ def test_byron_trans_list(wid)

# on target wallet
txt = SHELLEY.transactions.get(@wid, tx_id)
tx_fee(txt, 0)
expect(tx['fee']['quantity'].to_i).to be > 0
tx_inputs(txt, present: true)
tx_outputs(txt, present: true)
tx_direction(txt, 'incoming')
Expand Down

0 comments on commit c226379

Please sign in to comment.