Skip to content

Commit

Permalink
extend integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed May 31, 2023
1 parent fd065f1 commit b848372
Showing 1 changed file with 27 additions and 0 deletions.
Expand Up @@ -2126,6 +2126,11 @@ spec = describe "SHARED_TRANSACTIONS" $ do
, "passphrase": #{fixturePassphrase},
"withdrawal": "self"
}|]

rGet <- request @ApiWallet ctx (Link.getWallet @'Shared party1)
Default Empty
let previousBalance = getFromResponse (#balance . #available) rGet

rTx3 <- request @(ApiConstructTransaction n) ctx
(Link.createUnsignedTransaction @'Shared party1) Default payloadWithdrawal
verify rTx3
Expand All @@ -2148,6 +2153,28 @@ spec = describe "SHARED_TRANSACTIONS" $ do
[ expectResponseCode HTTP.status202
]

-- Rewards are have been consumed.
eventually "Party1's wallet has consumed rewards" $ do
request @ApiWallet ctx (Link.getWallet @'Shared party1) Default Empty
>>= flip verify
[ expectField
(#balance . #reward)
(`shouldBe` (Quantity 0))
, expectField
(#balance . #available)
(.> previousBalance)
]
eventually "Party2's wallet has consumed rewards" $ do
request @ApiWallet ctx (Link.getWallet @'Shared party2) Default Empty
>>= flip verify
[ expectField
(#balance . #reward)
(`shouldBe` (Quantity 0))
, expectField
(#balance . #available)
(.> previousBalance)
]

where
listSharedTransactions ctx w mStart mEnd mOrder mLimit = do
let path = Link.listTransactions' @'Shared w
Expand Down

0 comments on commit b848372

Please sign in to comment.