Skip to content

Commit

Permalink
Strengthen prop_applyBlocks_filteredTxs_someOurs.
Browse files Browse the repository at this point in the history
The `applyBlocks` function was recently changed so that fees of incoming
transactions are no longer stripped away (i.e., no longer replaced with
`Nothing`).

This change was made in the following commit:

120c7de

Consequently, it is now more straightforward to test our expectations
about the `fee` field within our property tests for `applyBlocks`.

This commit strengthens the `prop_applyBlocks_filteredTxs_someOurs`
property, which tests the `applyBlocks` function in scenarios where
**_only some_** transactions in an arbitrary block sequence are
relevant to an arbitrary wallet.

In particular, we now test that `applyBlocks` does not modify the `fee`
field in any way, whereas before, the `fee` field was deliberately
excluded from the test.
  • Loading branch information
jonathanknowles committed Mar 21, 2023
1 parent 76f09ef commit e29b0bc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/wallet/test/unit/Cardano/Wallet/Primitive/ModelSpec.hs
Expand Up @@ -2659,10 +2659,7 @@ prop_applyBlocks_filteredTxs_someOurs
-> Pretty BlockSeq
-> Property
prop_applyBlocks_filteredTxs_someOurs (Pretty someOurs) (Pretty blockSeq)
-- TODO: we currently ignore transaction fees, as under some circumstances
-- the 'applyBlocks' function can modify fee values:
= fmap (set #fee Nothing) ourTxsReturned ====
fmap (set #fee Nothing) ourTxsExpected
= ourTxsReturned ==== ourTxsExpected
& labelInterval 10
"length allTxsProvided"
(length allTxsProvided)
Expand Down

0 comments on commit e29b0bc

Please sign in to comment.