summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/testing.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-11-11 20:52:45 +0100
committerFlorian Dold <florian@dold.me>2022-11-11 20:52:53 +0100
commit233a354b4728b5efc76d19a530ad85a3a3e2a3d2 (patch)
tree7e426da749ba8f97bc8a5f4767f31fbc254675a9 /packages/taler-wallet-core/src/operations/testing.ts
parent22290020fba91253c9885eb9fa193a0dd98fa72f (diff)
downloadwallet-core-233a354b4728b5efc76d19a530ad85a3a3e2a3d2.tar.gz
wallet-core-233a354b4728b5efc76d19a530ad85a3a3e2a3d2.tar.bz2
wallet-core-233a354b4728b5efc76d19a530ad85a3a3e2a3d2.zip
fixes and polyfills for quickjs
Diffstat (limited to 'packages/taler-wallet-core/src/operations/testing.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/testing.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts
index 9a11af8bb..50454a920 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -18,8 +18,10 @@
* Imports.
*/
import {
+ base64FromArrayBuffer,
ConfirmPayResultType,
Logger,
+ stringToBytes,
TestPayResult,
WithdrawTestBalanceRequest,
} from "@gnu-taler/taler-util";
@@ -78,10 +80,11 @@ function makeId(length: number): string {
/**
* Helper function to generate the "Authorization" HTTP header.
+ * FIXME: redundant, put in taler-util
*/
function makeBasicAuthHeader(username: string, password: string): string {
const auth = `${username}:${password}`;
- const authEncoded: string = Buffer.from(auth).toString("base64");
+ const authEncoded: string = base64FromArrayBuffer(stringToBytes(auth));
return `Basic ${authEncoded}`;
}