From 829842054690fda15c7b0b2e53ba07c7d5f95d0e Mon Sep 17 00:00:00 2001 From: Pawel Jakubas Date: Thu, 31 Aug 2023 16:55:06 +0200 Subject: [PATCH] integration test - part 2 --- .../Scenario/API/Shelley/TransactionsNew.hs | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/lib/wallet/integration/src/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs b/lib/wallet/integration/src/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs index 80c805f471c..f1158ca3d6b 100644 --- a/lib/wallet/integration/src/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs +++ b/lib/wallet/integration/src/Test/Integration/Scenario/API/Shelley/TransactionsNew.hs @@ -61,7 +61,7 @@ import Cardano.Wallet.Api.Types , ApiEra (..) , ApiExternalCertificate (..) , ApiNetworkInformation - , ApiPolicyId + , ApiPolicyId (..) , ApiPolicyKey (..) , ApiRegisterPool (..) , ApiSerialisedTransaction (..) @@ -1166,8 +1166,8 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do [ RequireSignatureOf policyKeyHash ] - addrs <- listAddresses @n ctx wb - let destination = (addrs !! 1) ^. #id + addrsDest <- listAddresses @n ctx wb + let destination = (addrsDest !! 1) ^. #id let payload = Json [json|{ "reference_policy_script_template": { "all": [ "cosigner#0" ] }, @@ -1232,6 +1232,37 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do verify rGet [ expectResponseCode HTTP.status202 ] + let (ApiPolicyId (ApiT policyId')) = getFromResponse Prelude.id rGet + + eventually "wb wallet has received funds" $ do + request @ApiWallet ctx (Link.getWallet @'Shelley wb) Default Empty + >>= flip verify + [ expectField + (#balance . #available) + (.> (Quantity 0)) + ] + + addrsMint <- listAddresses @n ctx wa + let addrMint = (addrsMint !! 1) ^. #id + let payloadMint = Json [json|{ + "mint_burn": [{ + "policy_id": #{toText policyId'}, + "reference_input": #{toJSON refInp}, + "asset_name": "ab12", + "operation": + { "mint" : + { "receiving_address": #{addrMint}, + "quantity": 1000 + } + } + }] + }|] + + rTxMint <- request @(ApiConstructTransaction n) ctx + (Link.createUnsignedTransaction @'Shelley wa) Default payloadMint + verify rTxMint + [ expectResponseCode HTTP.status202 + ] it "TRANS_NEW_VALIDITY_INTERVAL_01a - \