save wire fee instead of effective amount
This commit is contained in:
parent
a8d30ef0f9
commit
b08bb05a40
@ -586,8 +586,8 @@ export interface TransactionDeposit extends TransactionCommon {
|
|||||||
timestampExecuted: TalerProtocolTimestamp;
|
timestampExecuted: TalerProtocolTimestamp;
|
||||||
// Total amount transfer for this wtid (including fees)
|
// Total amount transfer for this wtid (including fees)
|
||||||
amountRaw: AmountString;
|
amountRaw: AmountString;
|
||||||
// Total amount received for this wtid (without fees)
|
// Wire fee amount for this exchange
|
||||||
amountEffective: AmountString;
|
wireFee: AmountString;
|
||||||
}>;
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1680,8 +1680,8 @@ export interface DepositGroupRecord {
|
|||||||
timestampExecuted: TalerProtocolTimestamp;
|
timestampExecuted: TalerProtocolTimestamp;
|
||||||
// Total amount transfer for this wtid (including fees)
|
// Total amount transfer for this wtid (including fees)
|
||||||
amountRaw: AmountString;
|
amountRaw: AmountString;
|
||||||
// Total amount received for this wtid (without fees)
|
// Wire fee amount for this exchange
|
||||||
amountEffective: AmountString;
|
wireFee: AmountString;
|
||||||
exchangePub: string;
|
exchangePub: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -62,10 +62,10 @@ import {
|
|||||||
import {
|
import {
|
||||||
getBankStatusUrl,
|
getBankStatusUrl,
|
||||||
getBankWithdrawalInfo,
|
getBankWithdrawalInfo,
|
||||||
isWithdrawableDenom,
|
|
||||||
} from "./operations/withdraw.js";
|
} from "./operations/withdraw.js";
|
||||||
import { ExchangeInfo } from "./operations/exchanges.js";
|
import { ExchangeInfo } from "./operations/exchanges.js";
|
||||||
import { assembleRefreshRevealRequest } from "./operations/refresh.js";
|
import { assembleRefreshRevealRequest } from "./operations/refresh.js";
|
||||||
|
import { isWithdrawableDenom } from "./index.js";
|
||||||
|
|
||||||
const logger = new Logger("dbless.ts");
|
const logger = new Logger("dbless.ts");
|
||||||
|
|
||||||
|
@ -234,12 +234,11 @@ export async function processDepositGroup(
|
|||||||
);
|
);
|
||||||
const raw = Amounts.parseOrThrow(track.coin_contribution);
|
const raw = Amounts.parseOrThrow(track.coin_contribution);
|
||||||
const wireFee = Amounts.parseOrThrow(fee.wireFee);
|
const wireFee = Amounts.parseOrThrow(fee.wireFee);
|
||||||
const effective = Amounts.sub(raw, wireFee).amount;
|
|
||||||
|
|
||||||
newWiredTransaction = {
|
newWiredTransaction = {
|
||||||
value: {
|
value: {
|
||||||
amountRaw: Amounts.stringify(raw),
|
amountRaw: Amounts.stringify(raw),
|
||||||
amountEffective: Amounts.stringify(effective),
|
wireFee: Amounts.stringify(wireFee),
|
||||||
exchangePub: track.exchange_pub,
|
exchangePub: track.exchange_pub,
|
||||||
timestampExecuted: track.execution_time,
|
timestampExecuted: track.execution_time,
|
||||||
wireTransferId: track.wtid,
|
wireTransferId: track.wtid,
|
||||||
|
@ -61,9 +61,9 @@ import { updateExchangeFromUrl } from "./exchanges.js";
|
|||||||
import {
|
import {
|
||||||
getCandidateWithdrawalDenoms,
|
getCandidateWithdrawalDenoms,
|
||||||
getExchangeWithdrawalInfo,
|
getExchangeWithdrawalInfo,
|
||||||
selectWithdrawalDenominations,
|
|
||||||
updateWithdrawalDenoms,
|
updateWithdrawalDenoms,
|
||||||
} from "./withdraw.js";
|
} from "./withdraw.js";
|
||||||
|
import { selectWithdrawalDenominations } from "../util/coinSelection.js";
|
||||||
|
|
||||||
const logger = new Logger("operations/tip.ts");
|
const logger = new Logger("operations/tip.ts");
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import { Amounts, DenomKeyType } from "@gnu-taler/taler-util";
|
import { Amounts, DenomKeyType } from "@gnu-taler/taler-util";
|
||||||
import test from "ava";
|
import test from "ava";
|
||||||
import { DenominationRecord, DenominationVerificationStatus } from "../db.js";
|
import { DenominationRecord, DenominationVerificationStatus } from "../db.js";
|
||||||
import { selectWithdrawalDenominations } from "./withdraw.js";
|
import { selectWithdrawalDenominations } from "../util/coinSelection.js";
|
||||||
|
|
||||||
test("withdrawal selection bug repro", (t) => {
|
test("withdrawal selection bug repro", (t) => {
|
||||||
const amount = {
|
const amount = {
|
||||||
|
Loading…
Reference in New Issue
Block a user