aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts24
1 files changed, 19 insertions, 5 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts b/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
index e38b690ab..953ea6088 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
@@ -29,12 +29,12 @@ import {
j2s,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironmentV3,
createWalletDaemonWithClient,
withdrawViaBankV3,
-} from "../harness/helpers.js";
+} from "../harness/environments.js";
+import { GlobalTestState } from "../harness/harness.js";
/**
* Run a test for basic peer-push payments.
@@ -69,6 +69,19 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) {
await withdrawRes.withdrawalFinishedCond;
+ {
+ const maxResp1 = await w1.walletClient.call(
+ WalletApiOperation.GetMaxPeerPushDebitAmount,
+ {
+ currency: "TESTKUDOS",
+ },
+ );
+
+ t.assertDeepEqual(maxResp1.exchangeBaseUrl, exchange.baseUrl);
+ t.assertAmountEquals(maxResp1.rawAmount, "TESTKUDOS:19.1");
+ t.assertAmountEquals(maxResp1.effectiveAmount, "TESTKUDOS:19.53");
+ }
+
const purse_expiration = AbsoluteTime.toProtocolTimestamp(
AbsoluteTime.addDuration(
AbsoluteTime.now(),
@@ -83,6 +96,7 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) {
},
);
+ t.assertAmountEquals(checkResp0.amountRaw, "TESTKUDOS:5");
t.assertAmountEquals(checkResp0.amountEffective, "TESTKUDOS:5.49");
{
@@ -139,19 +153,19 @@ export async function runPeerToPeerPushTest(t: GlobalTestState) {
t.assertDeepEqual(txDetails.type, TransactionType.PeerPushDebit);
t.assertTrue(!!txDetails.talerUri);
- const checkResp = await w2.walletClient.call(
+ const prepareResp = await w2.walletClient.call(
WalletApiOperation.PreparePeerPushCredit,
{
talerUri: txDetails.talerUri,
},
);
- console.log(checkResp);
+ console.log(prepareResp);
const acceptResp = await w2.walletClient.call(
WalletApiOperation.ConfirmPeerPushCredit,
{
- transactionId: checkResp.transactionId,
+ transactionId: prepareResp.transactionId,
},
);