[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: -re-add field that's still in
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: -re-add field that's still in use |
Date: |
Wed, 13 Dec 2023 07:53:23 +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 81878c8cb -re-add field that's still in use
81878c8cb is described below
commit 81878c8cb8484e60cd153af377d30f462b0a69e8
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Dec 13 07:53:18 2023 +0100
-re-add field that's still in use
---
packages/taler-util/src/wallet-types.ts | 9 ++
.../src/wallet/AddExchange/test.ts | 109 ++++++++++++---------
2 files changed, 73 insertions(+), 45 deletions(-)
diff --git a/packages/taler-util/src/wallet-types.ts
b/packages/taler-util/src/wallet-types.ts
index b25b3e406..409aa07a6 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -1656,11 +1656,20 @@ export type GetExchangeEntryByUrlResponse =
ExchangeListItem;
export interface AddExchangeRequest {
exchangeBaseUrl: string;
+
+ /**
+ * @deprecated use a separate API call to start a forced exchange update
instead
+ */
+ forceUpdate?: boolean;
+
+ masterPub?: string;
}
export const codecForAddExchangeRequest = (): Codec<AddExchangeRequest> =>
buildCodecForObject<AddExchangeRequest>()
.property("exchangeBaseUrl", codecForString())
+ .property("forceUpdate", codecOptional(codecForBoolean()))
+ .property("masterPub", codecOptional(codecForString()))
.build("AddExchangeRequest");
export interface UpdateExchangeEntryRequest {
diff --git a/packages/taler-wallet-webextension/src/wallet/AddExchange/test.ts
b/packages/taler-wallet-webextension/src/wallet/AddExchange/test.ts
index f6aa2a3f9..f17872779 100644
--- a/packages/taler-wallet-webextension/src/wallet/AddExchange/test.ts
+++ b/packages/taler-wallet-webextension/src/wallet/AddExchange/test.ts
@@ -26,7 +26,11 @@ import { Props } from "./index.js";
import { useComponentState } from "./state.js";
import { nullFunction } from "../../mui/handlers.js";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { ExchangeEntryStatus, ExchangeTosStatus, ExchangeUpdateStatus } from
"@gnu-taler/taler-util";
+import {
+ ExchangeEntryStatus,
+ ExchangeTosStatus,
+ ExchangeUpdateStatus,
+} from "@gnu-taler/taler-util";
const props: Props = {
onBack: nullFunction,
noDebounce: true,
@@ -36,18 +40,24 @@ describe("AddExchange states", () => {
it("should start in 'verify' state", async () => {
const { handler, TestingContext } = createWalletApiMock();
- handler.addWalletCallResponse(WalletApiOperation.ListExchanges, {}, {
- exchanges:[{
- exchangeBaseUrl: "http://exchange.local/",
- ageRestrictionOptions: [],
- scopeInfo: undefined,
- currency: "ARS",
- exchangeEntryStatus: ExchangeEntryStatus.Ephemeral,
- tosStatus: ExchangeTosStatus.Pending,
- exchangeUpdateStatus: ExchangeUpdateStatus.Failed,
- paytoUris: [],
- }]
- })
+ handler.addWalletCallResponse(
+ WalletApiOperation.ListExchanges,
+ {},
+ {
+ exchanges: [
+ {
+ exchangeBaseUrl: "http://exchange.local/",
+ ageRestrictionOptions: [],
+ scopeInfo: undefined,
+ currency: "ARS",
+ exchangeEntryStatus: ExchangeEntryStatus.Ephemeral,
+ tosStatus: ExchangeTosStatus.Pending,
+ exchangeUpdateStatus: ExchangeUpdateStatus.UnavailableUpdate,
+ paytoUris: [],
+ },
+ ],
+ },
+ );
const hookBehavior = await tests.hookBehaveLikeThis(
useComponentState,
@@ -58,7 +68,7 @@ describe("AddExchange states", () => {
if (state.status !== "verify") return;
expect(state.url.value).eq("");
expect(state.expectedCurrency).is.undefined;
- expect(state.result).is.undefined;
+ expect(state.result).is.undefined;
},
(state) => {
expect(state.status).equal("verify");
@@ -75,23 +85,27 @@ describe("AddExchange states", () => {
expect(handler.getCallingQueueState()).eq("empty");
});
-
-
it("should not be able to add a known exchange", async () => {
const { handler, TestingContext } = createWalletApiMock();
- handler.addWalletCallResponse(WalletApiOperation.ListExchanges, {}, {
- exchanges:[{
- exchangeBaseUrl: "http://exchange.local/",
- ageRestrictionOptions: [],
- scopeInfo: undefined,
- currency: "ARS",
- exchangeEntryStatus: ExchangeEntryStatus.Used,
- tosStatus: ExchangeTosStatus.Pending,
- exchangeUpdateStatus: ExchangeUpdateStatus.Ready,
- paytoUris: [],
- }]
- })
+ handler.addWalletCallResponse(
+ WalletApiOperation.ListExchanges,
+ {},
+ {
+ exchanges: [
+ {
+ exchangeBaseUrl: "http://exchange.local/",
+ ageRestrictionOptions: [],
+ scopeInfo: undefined,
+ currency: "ARS",
+ exchangeEntryStatus: ExchangeEntryStatus.Used,
+ tosStatus: ExchangeTosStatus.Pending,
+ exchangeUpdateStatus: ExchangeUpdateStatus.Ready,
+ paytoUris: [],
+ },
+ ],
+ },
+ );
const hookBehavior = await tests.hookBehaveLikeThis(
useComponentState,
@@ -102,7 +116,7 @@ describe("AddExchange states", () => {
if (state.status !== "verify") return;
expect(state.url.value).eq("");
expect(state.expectedCurrency).is.undefined;
- expect(state.result).is.undefined;
+ expect(state.result).is.undefined;
},
(state) => {
expect(state.status).equal("verify");
@@ -113,7 +127,7 @@ describe("AddExchange states", () => {
expect(state.error).is.undefined;
expect(state.url.onInput).is.not.undefined;
if (!state.url.onInput) return;
- state.url.onInput("http://exchange.local/")
+ state.url.onInput("http://exchange.local/");
},
(state) => {
expect(state.status).equal("verify");
@@ -132,22 +146,27 @@ describe("AddExchange states", () => {
expect(handler.getCallingQueueState()).eq("empty");
});
-
it("should be able to add a preset exchange", async () => {
const { handler, TestingContext } = createWalletApiMock();
- handler.addWalletCallResponse(WalletApiOperation.ListExchanges, {}, {
- exchanges:[{
- exchangeBaseUrl: "http://exchange.local/",
- ageRestrictionOptions: [],
- scopeInfo: undefined,
- currency: "ARS",
- exchangeEntryStatus: ExchangeEntryStatus.Preset,
- tosStatus: ExchangeTosStatus.Pending,
- exchangeUpdateStatus: ExchangeUpdateStatus.Ready,
- paytoUris: [],
- }]
- })
+ handler.addWalletCallResponse(
+ WalletApiOperation.ListExchanges,
+ {},
+ {
+ exchanges: [
+ {
+ exchangeBaseUrl: "http://exchange.local/",
+ ageRestrictionOptions: [],
+ scopeInfo: undefined,
+ currency: "ARS",
+ exchangeEntryStatus: ExchangeEntryStatus.Preset,
+ tosStatus: ExchangeTosStatus.Pending,
+ exchangeUpdateStatus: ExchangeUpdateStatus.Ready,
+ paytoUris: [],
+ },
+ ],
+ },
+ );
const hookBehavior = await tests.hookBehaveLikeThis(
useComponentState,
@@ -158,7 +177,7 @@ describe("AddExchange states", () => {
if (state.status !== "verify") return;
expect(state.url.value).eq("");
expect(state.expectedCurrency).is.undefined;
- expect(state.result).is.undefined;
+ expect(state.result).is.undefined;
},
(state) => {
expect(state.status).equal("verify");
@@ -169,7 +188,7 @@ describe("AddExchange states", () => {
expect(state.error).is.undefined;
expect(state.url.onInput).is.not.undefined;
if (!state.url.onInput) return;
- state.url.onInput("http://exchange.local/")
+ state.url.onInput("http://exchange.local/");
},
],
TestingContext,
--
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: -re-add field that's still in use,
gnunet <=