diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-19 20:42:49 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-19 20:42:49 +0100 |
commit | 0c9358c1b2bd80e25940022e86bd8daef8184ad7 (patch) | |
tree | a8c8ca0134bd886d8151633aff4c85e9513ad32c /src/types/types-test.ts | |
parent | 49e3b3e5b9bbf1ce356ef68f301d50c689ceecb9 (diff) | |
download | wallet-core-0c9358c1b2bd80e25940022e86bd8daef8184ad7.tar.xz |
new date format, replace checkable annotations with codecs
Diffstat (limited to 'src/types/types-test.ts')
-rw-r--r-- | src/types/types-test.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/types/types-test.ts b/src/types/types-test.ts index a686fbe38..77ab2c4e4 100644 --- a/src/types/types-test.ts +++ b/src/types/types-test.ts @@ -16,7 +16,7 @@ import test from "ava"; import * as Amounts from "../util/amounts"; -import { ContractTerms } from "./talerTypes"; +import { ContractTerms, codecForContractTerms } from "./talerTypes"; const amt = ( value: number, @@ -130,6 +130,7 @@ test("amount stringification", t => { test("contract terms validation", t => { const c = { + nonce: "123123123", H_wire: "123", amount: "EUR:1.5", auditors: [], @@ -138,23 +139,23 @@ test("contract terms validation", t => { max_fee: "EUR:1.5", merchant_pub: "12345", order_id: "test_order", - pay_deadline: "Date(12346)", - wire_transfer_deadline: "Date(12346)", + pay_deadline: { t_ms: 42 }, + wire_transfer_deadline: { t_ms: 42 }, merchant_base_url: "https://example.com/pay", products: [], - refund_deadline: "Date(12345)", + refund_deadline: { t_ms: 42 }, summary: "hello", - timestamp: "Date(12345)", + timestamp: { t_ms: 42 }, wire_method: "test", }; - ContractTerms.checked(c); + codecForContractTerms().decode(c); const c1 = JSON.parse(JSON.stringify(c)); - c1.exchanges = []; + c1.pay_deadline = "foo"; try { - ContractTerms.checked(c1); + codecForContractTerms().decode(c1); } catch (e) { t.pass(); return; |