aboutsummaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-12 19:25:38 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-12 19:25:38 +0530
commitb5b8f96cc94e3a3c0ee7d989819197ab5df393cd (patch)
tree0382770a735c4f43e09bfb9d03345bc93ecc498a /src/types
parent2ec6799c8c6836d44944460a41fabefb8eb8186f (diff)
downloadwallet-core-b5b8f96cc94e3a3c0ee7d989819197ab5df393cd.tar.xz
improved error reporting / towards a working recoup
Diffstat (limited to 'src/types')
-rw-r--r--src/types/ReserveTransaction.ts34
-rw-r--r--src/types/dbTypes.ts5
-rw-r--r--src/types/notifications.ts21
-rw-r--r--src/types/pending.ts2
-rw-r--r--src/types/talerTypes.ts16
5 files changed, 45 insertions, 33 deletions
diff --git a/src/types/ReserveTransaction.ts b/src/types/ReserveTransaction.ts
index e889f36a8..ba5ce3ffc 100644
--- a/src/types/ReserveTransaction.ts
+++ b/src/types/ReserveTransaction.ts
@@ -40,7 +40,7 @@ import { Timestamp, codecForTimestamp } from "../util/time";
export const enum ReserveTransactionType {
Withdraw = "WITHDRAW",
Deposit = "DEPOSIT",
- Payback = "PAYBACK",
+ Recoup = "RECOUP",
Closing = "CLOSING",
}
@@ -139,8 +139,8 @@ export interface ReserveClosingTransaction {
timestamp: Timestamp;
}
-export interface ReservePaybackTransaction {
- type: ReserveTransactionType.Payback;
+export interface ReserveRecoupTransaction {
+ type: ReserveTransactionType.Recoup;
/**
* Amount paid back.
@@ -148,16 +148,6 @@ export interface ReservePaybackTransaction {
amount: AmountString;
/**
- * Receiver account details.
- */
- receiver_account_details: any;
-
- /**
- * Wire transfer identifier.
- */
- wire_transfer: any;
-
- /**
* This is a signature over
* a struct TALER_PaybackConfirmationPS with purpose
* TALER_SIGNATURE_EXCHANGE_CONFIRM_PAYBACK.
@@ -187,7 +177,7 @@ export type ReserveTransaction =
| ReserveWithdrawTransaction
| ReserveDepositTransaction
| ReserveClosingTransaction
- | ReservePaybackTransaction;
+ | ReserveRecoupTransaction;
export const codecForReserveWithdrawTransaction = () =>
typecheckedCodec<ReserveWithdrawTransaction>(
@@ -229,18 +219,16 @@ export const codecForReserveClosingTransaction = () =>
.build("ReserveClosingTransaction"),
);
-export const codecForReservePaybackTransaction = () =>
- typecheckedCodec<ReservePaybackTransaction>(
- makeCodecForObject<ReservePaybackTransaction>()
+export const codecForReserveRecoupTransaction = () =>
+ typecheckedCodec<ReserveRecoupTransaction>(
+ makeCodecForObject<ReserveRecoupTransaction>()
.property("amount", codecForString)
.property("coin_pub", codecForString)
.property("exchange_pub", codecForString)
.property("exchange_sig", codecForString)
- .property("receiver_account_details", codecForString)
.property("timestamp", codecForTimestamp)
- .property("type", makeCodecForConstString(ReserveTransactionType.Payback))
- .property("wire_transfer", codecForString)
- .build("ReservePaybackTransaction"),
+ .property("type", makeCodecForConstString(ReserveTransactionType.Recoup))
+ .build("ReserveRecoupTransaction"),
);
export const codecForReserveTransaction = () =>
@@ -256,8 +244,8 @@ export const codecForReserveTransaction = () =>
codecForReserveClosingTransaction(),
)
.alternative(
- ReserveTransactionType.Payback,
- codecForReservePaybackTransaction(),
+ ReserveTransactionType.Recoup,
+ codecForReserveRecoupTransaction(),
)
.alternative(
ReserveTransactionType.Deposit,
diff --git a/src/types/dbTypes.ts b/src/types/dbTypes.ts
index 56c1f82eb..36b45f5ac 100644
--- a/src/types/dbTypes.ts
+++ b/src/types/dbTypes.ts
@@ -1457,6 +1457,11 @@ export namespace Stores {
"denomPubIndex",
"denomPub",
);
+ denomPubHashIndex = new Index<string, CoinRecord>(
+ this,
+ "denomPubHashIndex",
+ "denomPubHash",
+ );
}
class ProposalsStore extends Store<ProposalRecord> {
diff --git a/src/types/notifications.ts b/src/types/notifications.ts
index 34e98fe2c..39930dcca 100644
--- a/src/types/notifications.ts
+++ b/src/types/notifications.ts
@@ -26,8 +26,8 @@ export const enum NotificationType {
ProposalAccepted = "proposal-accepted",
ProposalDownloaded = "proposal-downloaded",
RefundsSubmitted = "refunds-submitted",
- RecoupStarted = "payback-started",
- RecoupFinished = "payback-finished",
+ RecoupStarted = "recoup-started",
+ RecoupFinished = "recoup-finished",
RefreshRevealed = "refresh-revealed",
RefreshMelted = "refresh-melted",
RefreshStarted = "refresh-started",
@@ -44,7 +44,7 @@ export const enum NotificationType {
RefundFinished = "refund-finished",
ExchangeOperationError = "exchange-operation-error",
RefreshOperationError = "refresh-operation-error",
- RecoupOperationError = "refresh-operation-error",
+ RecoupOperationError = "recoup-operation-error",
RefundApplyOperationError = "refund-apply-error",
RefundStatusOperationError = "refund-status-error",
ProposalOperationError = "proposal-error",
@@ -82,11 +82,11 @@ export interface RefundsSubmittedNotification {
proposalId: string;
}
-export interface PaybackStartedNotification {
+export interface RecoupStartedNotification {
type: NotificationType.RecoupStarted;
}
-export interface PaybackFinishedNotification {
+export interface RecoupFinishedNotification {
type: NotificationType.RecoupFinished;
}
@@ -171,6 +171,10 @@ export interface WithdrawOperationErrorNotification {
type: NotificationType.WithdrawOperationError;
}
+export interface RecoupOperationErrorNotification {
+ type: NotificationType.RecoupOperationError;
+}
+
export interface ReserveOperationErrorNotification {
type: NotificationType.ReserveOperationError;
operationError: OperationError;
@@ -197,8 +201,8 @@ export type WalletNotification =
| ProposalAcceptedNotification
| ProposalDownloadedNotification
| RefundsSubmittedNotification
- | PaybackStartedNotification
- | PaybackFinishedNotification
+ | RecoupStartedNotification
+ | RecoupFinishedNotification
| RefreshMeltedNotification
| RefreshRevealedNotification
| RefreshStartedNotification
@@ -214,4 +218,5 @@ export type WalletNotification =
| RefundQueriedNotification
| WithdrawSessionCreatedNotification
| CoinWithdrawnNotification
- | WildcardNotification;
+ | WildcardNotification
+ | RecoupOperationErrorNotification;
diff --git a/src/types/pending.ts b/src/types/pending.ts
index 5d732c520..d9d17a3b9 100644
--- a/src/types/pending.ts
+++ b/src/types/pending.ts
@@ -204,6 +204,8 @@ export interface PendingRefundApplyOperation {
export interface PendingRecoupOperation {
type: PendingOperationType.Recoup;
recoupGroupId: string;
+ retryInfo: RetryInfo;
+ lastError: OperationError | undefined;
}
/**
diff --git a/src/types/talerTypes.ts b/src/types/talerTypes.ts
index e65c82383..2ecb82340 100644
--- a/src/types/talerTypes.ts
+++ b/src/types/talerTypes.ts
@@ -148,10 +148,10 @@ export class Auditor {
*/
export interface RecoupRequest {
/**
- * Denomination public key of the coin we want to get
+ * Hashed enomination public key of the coin we want to get
* paid back.
*/
- denom_pub: string;
+ denom_pub_hash: string;
/**
* Signature over the coin public key by the denomination.
@@ -744,6 +744,10 @@ export class TipPickupGetResponse {
stamp_created: Timestamp;
}
+export class WithdrawResponse {
+ ev_sig: string;
+}
+
export type AmountString = string;
export type Base32String = string;
export type EddsaSignatureString = string;
@@ -976,3 +980,11 @@ export const codecForRecoupConfirmation = () =>
.property("exchange_pub", codecForString)
.build("RecoupConfirmation"),
);
+
+
+export const codecForWithdrawResponse = () =>
+ typecheckedCodec<WithdrawResponse>(
+ makeCodecForObject<WithdrawResponse>()
+ .property("ev_sig", codecForString)
+ .build("WithdrawResponse"),
+ ); \ No newline at end of file