[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: fix CheckPaymentPaidResponse
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: fix CheckPaymentPaidResponse schema |
Date: |
Tue, 03 Nov 2020 13:47:13 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new e259d109 fix CheckPaymentPaidResponse schema
e259d109 is described below
commit e259d109efd998d0ff6197123a47b83bfe274680
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Nov 3 13:46:44 2020 +0100
fix CheckPaymentPaidResponse schema
---
packages/taler-integrationtests/src/merchantApiTypes.ts | 2 +-
packages/taler-wallet-core/src/util/codec.ts | 9 ++++++++-
pnpm-lock.yaml | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/packages/taler-integrationtests/src/merchantApiTypes.ts
b/packages/taler-integrationtests/src/merchantApiTypes.ts
index 1806ab70..1cfc72db 100644
--- a/packages/taler-integrationtests/src/merchantApiTypes.ts
+++ b/packages/taler-integrationtests/src/merchantApiTypes.ts
@@ -82,7 +82,7 @@ export const codecForCheckPaymentPaidResponse = (): Codec<
CheckPaymentPaidResponse
> =>
buildCodecForObject<CheckPaymentPaidResponse>()
- .property("order_status_url", codecForConstString("paid"))
+ .property("order_status_url", codecForString())
.property("order_status", codecForConstString("paid"))
.property("refunded", codecForBoolean())
.property("wired", codecForBoolean())
diff --git a/packages/taler-wallet-core/src/util/codec.ts
b/packages/taler-wallet-core/src/util/codec.ts
index 4654c8b9..8605ff33 100644
--- a/packages/taler-wallet-core/src/util/codec.ts
+++ b/packages/taler-wallet-core/src/util/codec.ts
@@ -341,10 +341,17 @@ export function codecForConstString<V extends string>(s:
V): Codec<V> {
if (x === s) {
return x;
}
+ if (typeof x !== "string") {
+ throw new DecodingError(
+ `expected string constant "${s}" at ${renderContext(
+ c,
+ )} but got ${typeof x}`,
+ );
+ }
throw new DecodingError(
`expected string constant "${s}" at ${renderContext(
c,
- )} but got ${typeof x}`,
+ )} but got string value "${x}"`,
);
},
};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f8b23685..5bca329c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -233,7 +233,7 @@ importers:
taler-wallet-core: 'workspace:*'
tslib: ^2.0.1
typescript: ^3.9.7
-lockfileVersion: 5.1
+lockfileVersion: 5.2
packages:
/@ava/typescript/1.1.1:
dependencies:
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: fix CheckPaymentPaidResponse schema,
gnunet <=