Skip to content

Commit

Permalink
Additional assertion on decoding in construct->sign->submit testsv
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra committed Mar 22, 2022
1 parent 9ecf8ee commit cd062e9
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions test/e2e/spec/e2e_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ def run_contract(contract_setup, scripts)
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
expect(tx_constructed).to be_correct_and_respond 202
expected_fee = tx_constructed['fee']['quantity']
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
expect(tx_decoded).to be_correct_and_respond 202

decoded_fee = tx_decoded['fee']['quantity']
expect(expected_fee).to eq decoded_fee

tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
Expand Down Expand Up @@ -324,7 +327,10 @@ def run_contract(contract_setup, scripts)
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
expect(tx_constructed).to be_correct_and_respond 202
expected_fee = tx_constructed['fee']['quantity']
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
expect(tx_decoded).to be_correct_and_respond 202

decoded_fee = tx_decoded['fee']['quantity']
expect(expected_fee).to eq decoded_fee

tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
Expand Down Expand Up @@ -371,7 +377,10 @@ def run_contract(contract_setup, scripts)
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
expect(tx_constructed).to be_correct_and_respond 202
expected_fee = tx_constructed['fee']['quantity']
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
expect(tx_decoded).to be_correct_and_respond 202

decoded_fee = tx_decoded['fee']['quantity']
expect(expected_fee).to eq decoded_fee

tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
Expand Down Expand Up @@ -419,7 +428,10 @@ def run_contract(contract_setup, scripts)
withdrawal = tx_constructed['coin_selection']['withdrawals'].map { |x| x['amount']['quantity'] }.first
expect(withdrawal).to eq 0
expected_fee = tx_constructed['fee']['quantity']
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
expect(tx_decoded).to be_correct_and_respond 202

decoded_fee = tx_decoded['fee']['quantity']
expect(expected_fee).to eq decoded_fee

tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
Expand Down Expand Up @@ -451,7 +463,10 @@ def run_contract(contract_setup, scripts)
metadata)
expect(tx_constructed).to be_correct_and_respond 202
expected_fee = tx_constructed['fee']['quantity']
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
expect(tx_decoded).to be_correct_and_respond 202

decoded_fee = tx_decoded['fee']['quantity']
expect(expected_fee).to eq decoded_fee

tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
Expand Down Expand Up @@ -548,6 +563,8 @@ def run_contract(contract_setup, scripts)

# Check fee and deposit on quitting
decoded_tx = SHELLEY.transactions.decode(@target_id, tx_constructed["transaction"])
expect(decoded_tx).to be_correct_and_respond 202

expect(tx_constructed['coin_selection']['deposits_taken']).to eq []
expect(decoded_tx['deposits_taken']).to eq []
deposit_returned = tx_constructed['coin_selection']['deposits_returned'].first['quantity']
Expand Down Expand Up @@ -1237,7 +1254,10 @@ def test_byron_assets_tx(source_id, target_id)
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
expect(tx_constructed).to be_correct_and_respond 202
expected_fee = tx_constructed['fee']['quantity']
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
expect(tx_decoded).to be_correct_and_respond 202

decoded_fee = tx_decoded['fee']['quantity']
expect(expected_fee).to eq decoded_fee

tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
Expand Down

0 comments on commit cd062e9

Please sign in to comment.