Skip to content

Commit

Permalink
Verify asset balances are zero in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl authored and Anviking committed Jan 25, 2021
1 parent f110c84 commit af2ce54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2772,14 +2772,18 @@ spec = describe "SHELLEY_TRANSACTIONS" $ do
-> Quantity "lovelace" Natural
-> m ()
verifyWalletBalance ctx wallet amt = do
eventually "Wallet balance is as expected" $ do
eventually "Wallet Ada balance is as expected" $ do
rGet <- request @ApiWallet ctx
(Link.getWallet @'Shelley wallet) Default Empty
verify rGet
[ expectField
(#balance . #total) (`shouldBe` amt)
, expectField
(#balance . #available) (`shouldBe` amt)
, expectField
(#assets . #total) (`shouldBe` mempty)
, expectField
(#assets . #available) (`shouldBe` mempty)
]

mkTxPayload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ spec = describe "SHELLEY_WALLETS" $ do
, expectField (#balance . #available) (`shouldBe` Quantity 0)
, expectField (#balance . #total) (`shouldBe` Quantity 0)
, expectField (#balance . #reward) (`shouldBe` Quantity 0)

, expectField (#assets . #total) (`shouldBe` mempty)
, expectField (#assets . #available) (`shouldBe` mempty)
, expectField #delegation (`shouldBe` notDelegating [])
, expectField #passphrase (`shouldNotBe` Nothing)
]
Expand Down Expand Up @@ -230,6 +231,8 @@ spec = describe "SHELLEY_WALLETS" $ do
[ expectResponseCode HTTP.status201
, expectField (#balance . #available) (`shouldBe` Quantity 0)
, expectField (#balance . #total) (`shouldBe` Quantity 0)
, expectField (#assets . #available) (`shouldBe` mempty)
, expectField (#assets . #total) (`shouldBe` mempty)
]

--send funds
Expand All @@ -254,10 +257,14 @@ spec = describe "SHELLEY_WALLETS" $ do
rGet <- request @ApiWallet ctx
(Link.getWallet @'Shelley wDest) Default Empty
verify rGet
[ expectField
(#balance . #total) (`shouldBe` Quantity minUTxOValue)
, expectField
(#balance . #available) (`shouldBe` Quantity minUTxOValue)
[ expectField (#balance . #total)
(`shouldBe` Quantity minUTxOValue)
, expectField (#balance . #available)
(`shouldBe` Quantity minUTxOValue)
, expectField (#assets . #available)
(`shouldBe` mempty)
, expectField (#assets . #total)
(`shouldBe` mempty)
]

-- delete wallet
Expand Down

0 comments on commit af2ce54

Please sign in to comment.