Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test for 1004 regression #1010

Merged
merged 2 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import Test.Integration.Framework.DSL
, expectEventually'
, expectFieldBetween
, expectFieldEqual
, expectListItemFieldBetween
, expectListItemFieldEqual
, expectListSizeEqual
, expectResponseCode
Expand Down Expand Up @@ -141,7 +142,8 @@ data TestCase a = TestCase
spec :: forall t n. (n ~ 'Testnet) => SpecWith (Context t)
spec = do
it "Regression #1004 -\
\ Incorrect transaction amount reported on pending txs" $ \ctx -> do
\ Transaction to self shows only fees as a tx amount\
\ while both, pending and in_ledger" $ \ctx -> do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

wSrc <- fixtureWallet ctx
let (feeMin, feeMax) = ctx ^. feeEstimator $ TxDescription
{ nInputs = 1
Expand All @@ -153,11 +155,28 @@ spec = do
verify r
[ expectSuccess
, expectResponseCode HTTP.status202
-- tx amount includes only fees because it is tx to self address
-- when tx is pending
, expectFieldBetween amount (feeMin, feeMax)
, expectFieldEqual direction Outgoing
, expectFieldEqual status Pending
]

eventually_ $ do
rt <- request @([ApiTransaction n]) ctx
(listTxEp wSrc mempty)
Default
Empty
verify rt
[ expectSuccess
, expectResponseCode HTTP.status200
-- tx amount includes only fees because it is tx to self address
-- also when tx is already in ledger
, expectListItemFieldBetween 0 amount (feeMin, feeMax)
, expectListItemFieldEqual 0 direction Outgoing
, expectListItemFieldEqual 0 status InLedger
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯


it "Regression #935 -\
\ Pending tx should have pendingSince in the list tx response" $ \ctx -> do
wSrc <- fixtureWalletWith ctx [5_000_000]
Expand Down
2 changes: 1 addition & 1 deletion lib/jormungandr/test/data/jormungandr/start_node
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cardano-wallet-jormungandr launch --genesis-block block0.bin --node-port 8080 -- --secret secret.yaml --config config.yaml
cardano-wallet-jormungandr launch --genesis-block block0.bin --node-port 8080 --state-dir ./data -- --secret secret.yaml --config config.yaml