fix up imports, no more esm in tests
This commit is contained in:
parent
bed86d9613
commit
1cde390c23
@ -40,9 +40,6 @@
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"ava": {
|
||||
"require": [
|
||||
"esm"
|
||||
],
|
||||
"files": [
|
||||
"lib/*test*"
|
||||
]
|
||||
|
@ -25,7 +25,7 @@ import {
|
||||
codecForConstString,
|
||||
codecForString,
|
||||
buildCodecForUnion,
|
||||
} from "./codec";
|
||||
} from "./codec.js";
|
||||
|
||||
interface MyObj {
|
||||
foo: string;
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import test from "ava";
|
||||
import * as helpers from "./helpers";
|
||||
import * as helpers from "./helpers.js";
|
||||
|
||||
test("URL canonicalization", (t) => {
|
||||
// converts to relative, adds https
|
||||
|
@ -1,6 +1,6 @@
|
||||
// @ts-ignore: no type decl for this library
|
||||
import * as jedLib from "jed";
|
||||
import { Logger } from "./logging";
|
||||
import { Logger } from "./logging.js";
|
||||
|
||||
const logger = new Logger("i18n/index.ts");
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
import * as LibtoolVersion from "./libtool-version";
|
||||
import * as LibtoolVersion from "./libtool-version.js";
|
||||
|
||||
import test from "ava";
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
import test from "ava";
|
||||
|
||||
import { parsePaytoUri } from "./payto";
|
||||
import { parsePaytoUri } from "./payto.js";
|
||||
|
||||
test("basic payto parsing", (t) => {
|
||||
const r1 = parsePaytoUri("https://example.com/");
|
||||
|
@ -18,7 +18,7 @@
|
||||
* Imports
|
||||
*/
|
||||
import test from "ava";
|
||||
import { pathsub, Configuration } from "./talerconfig";
|
||||
import { pathsub, Configuration } from "./talerconfig.js";
|
||||
|
||||
test("pathsub", (t) => {
|
||||
t.assert("foo" === pathsub("foo", () => undefined));
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
parseWithdrawUri,
|
||||
parseRefundUri,
|
||||
parseTipUri,
|
||||
} from "./taleruri";
|
||||
} from "./taleruri.js";
|
||||
|
||||
test("taler pay url parsing: wrong scheme", (t) => {
|
||||
const url1 = "talerfoo://";
|
||||
|
@ -30,6 +30,7 @@
|
||||
],
|
||||
"main": "./dist/taler-wallet-core.js",
|
||||
"module": "./lib/index.js",
|
||||
"type": "module",
|
||||
"types": "./lib/index.d.ts",
|
||||
"devDependencies": {
|
||||
"@ava/typescript": "^1.1.1",
|
||||
@ -44,7 +45,6 @@
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-react": "^7.22.0",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"esm": "^3.2.25",
|
||||
"jed": "^1.1.1",
|
||||
"nyc": "^15.1.0",
|
||||
"po2json": "^0.4.5",
|
||||
@ -67,21 +67,8 @@
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"ava": {
|
||||
"require": [
|
||||
"esm"
|
||||
],
|
||||
"files": [
|
||||
"src/**/*.test.*"
|
||||
],
|
||||
"typescript": {
|
||||
"extensions": [
|
||||
"js",
|
||||
"ts",
|
||||
"tsx"
|
||||
],
|
||||
"rewritePaths": {
|
||||
"src/": "lib/"
|
||||
}
|
||||
}
|
||||
"lib/**/*test*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,8 @@
|
||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
import * as nacl from "./nacl-fast";
|
||||
import { sha256 } from "./sha256";
|
||||
import * as nacl from "./nacl-fast.js";
|
||||
import { sha256 } from "./sha256.js";
|
||||
|
||||
export function sha512(data: Uint8Array): Uint8Array {
|
||||
return nacl.hash(data);
|
||||
|
@ -30,9 +30,9 @@ import {
|
||||
stringToBytes,
|
||||
bytesToString,
|
||||
rsaVerify,
|
||||
} from "./talerCrypto";
|
||||
import { sha512, kdf } from "./primitives/kdf";
|
||||
import * as nacl from "./primitives/nacl-fast";
|
||||
} from "./talerCrypto.js";
|
||||
import { sha512, kdf } from "./primitives/kdf.js";
|
||||
import * as nacl from "./primitives/nacl-fast.js";
|
||||
|
||||
test("encoding", (t) => {
|
||||
const s = "Hello, World";
|
||||
|
@ -18,9 +18,9 @@
|
||||
* Native implementation of GNU Taler crypto.
|
||||
*/
|
||||
|
||||
import * as nacl from "./primitives/nacl-fast";
|
||||
import * as nacl from "./primitives/nacl-fast.js";
|
||||
import bigint from "big-integer";
|
||||
import { kdf } from "./primitives/kdf";
|
||||
import { kdf } from "./primitives/kdf.js";
|
||||
|
||||
// @ts-ignore
|
||||
const decoder = new TextDecoder();
|
||||
|
@ -22,9 +22,9 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { CoinRecord, DenominationRecord, WireFee } from "../../db";
|
||||
import { CoinRecord, DenominationRecord, WireFee } from "../../db.js";
|
||||
|
||||
import { CryptoWorker } from "./cryptoWorker";
|
||||
import { CryptoWorker } from "./cryptoWorker.js";
|
||||
|
||||
import { RecoupRequest, CoinDepositPermission } from "@gnu-taler/taler-util";
|
||||
|
||||
@ -36,7 +36,7 @@ import {
|
||||
MakeSyncSignatureRequest,
|
||||
} from "@gnu-taler/taler-util";
|
||||
|
||||
import * as timer from "../../util/timer";
|
||||
import * as timer from "../../util/timer.js";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
DerivedRefreshSession,
|
||||
|
@ -26,7 +26,7 @@ import {
|
||||
StoreDescriptor,
|
||||
StoreWithIndexes,
|
||||
IndexDescriptor,
|
||||
} from "./util/query";
|
||||
} from "./util/query.js";
|
||||
import { IDBFactory, IDBDatabase, IDBTransaction } from "@gnu-taler/idb-bridge";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
|
@ -24,7 +24,7 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { hash } from "../../crypto/primitives/nacl-fast";
|
||||
import { hash } from "../../crypto/primitives/nacl-fast.js";
|
||||
import {
|
||||
WalletBackupContentV1,
|
||||
BackupExchange,
|
||||
@ -49,11 +49,8 @@ import {
|
||||
BackupRefreshSession,
|
||||
BackupExchangeDetails,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { InternalWalletState } from "../state";
|
||||
import {
|
||||
provideBackupState,
|
||||
getWalletBackupState,
|
||||
} from "./state";
|
||||
import { InternalWalletState } from "../state.js";
|
||||
import { provideBackupState, getWalletBackupState } from "./state";
|
||||
import { Amounts, getTimestampNow } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
CoinSourceType,
|
||||
|
@ -50,9 +50,9 @@ import { PayCoinSelection } from "../../util/coinSelection";
|
||||
import { j2s } from "@gnu-taler/taler-util";
|
||||
import { checkDbInvariant, checkLogicInvariant } from "../../util/invariants";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { initRetryInfo } from "../../util/retries";
|
||||
import { InternalWalletState } from "../state";
|
||||
import { provideBackupState } from "./state";
|
||||
import { initRetryInfo } from "../../util/retries.js";
|
||||
import { InternalWalletState } from "../state.js";
|
||||
import { provideBackupState } from "./state.js";
|
||||
import { makeEventId, TombstoneTag } from "../transactions.js";
|
||||
import { getExchangeDetails } from "../exchanges.js";
|
||||
import { GetReadOnlyAccess, GetReadWriteAccess } from "../../util/query.js";
|
||||
|
@ -24,7 +24,7 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { InternalWalletState } from "../state";
|
||||
import { InternalWalletState } from "../state.js";
|
||||
import {
|
||||
AmountString,
|
||||
BackupRecovery,
|
||||
@ -38,7 +38,7 @@ import {
|
||||
WalletBackupConfState,
|
||||
WALLET_BACKUP_STATE_KEY,
|
||||
} from "../../db.js";
|
||||
import { checkDbInvariant, checkLogicInvariant } from "../../util/invariants";
|
||||
import { checkDbInvariant, checkLogicInvariant } from "../../util/invariants.js";
|
||||
import {
|
||||
bytesToString,
|
||||
decodeCrock,
|
||||
@ -49,7 +49,7 @@ import {
|
||||
hash,
|
||||
rsaBlind,
|
||||
stringToBytes,
|
||||
} from "../../crypto/talerCrypto";
|
||||
} from "../../crypto/talerCrypto.js";
|
||||
import { canonicalizeBaseUrl, canonicalJson, j2s } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
durationFromSpec,
|
||||
@ -57,7 +57,7 @@ import {
|
||||
Timestamp,
|
||||
timestampAddDuration,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { URL } from "../../util/url";
|
||||
import { URL } from "../../util/url.js";
|
||||
import {
|
||||
buildCodecForObject,
|
||||
Codec,
|
||||
@ -70,11 +70,11 @@ import {
|
||||
HttpResponseStatus,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
readTalerErrorResponse,
|
||||
} from "../../util/http";
|
||||
} from "../../util/http.js";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { gunzipSync, gzipSync } from "fflate";
|
||||
import { kdf } from "../../crypto/primitives/kdf";
|
||||
import { initRetryInfo } from "../../util/retries";
|
||||
import { kdf } from "../../crypto/primitives/kdf.js";
|
||||
import { initRetryInfo } from "../../util/retries.js";
|
||||
import {
|
||||
ConfirmPayResultType,
|
||||
PreparePayResultType,
|
||||
@ -82,12 +82,12 @@ import {
|
||||
RecoveryMergeStrategy,
|
||||
TalerErrorDetails,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { CryptoApi } from "../../crypto/workers/cryptoApi";
|
||||
import { secretbox, secretbox_open } from "../../crypto/primitives/nacl-fast";
|
||||
import { checkPaymentByProposalId, confirmPay, preparePayForUri } from "../pay";
|
||||
import { exportBackup } from "./export";
|
||||
import { BackupCryptoPrecomputedData, importBackup } from "./import";
|
||||
import { provideBackupState, getWalletBackupState } from "./state";
|
||||
import { CryptoApi } from "../../crypto/workers/cryptoApi.js";
|
||||
import { secretbox, secretbox_open } from "../../crypto/primitives/nacl-fast.js";
|
||||
import { checkPaymentByProposalId, confirmPay, preparePayForUri } from "../pay.js";
|
||||
import { exportBackup } from "./export.js";
|
||||
import { BackupCryptoPrecomputedData, importBackup } from "./import.js";
|
||||
import { provideBackupState, getWalletBackupState } from "./state.js";
|
||||
|
||||
const logger = new Logger("operations/backup.ts");
|
||||
|
||||
|
@ -14,16 +14,16 @@
|
||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
import { encodeCrock, getRandomBytes } from "../../crypto/talerCrypto.js";
|
||||
import {
|
||||
ConfigRecord,
|
||||
WalletBackupConfState,
|
||||
WalletStoresV1,
|
||||
WALLET_BACKUP_STATE_KEY,
|
||||
} from "../../db.js";
|
||||
import { getRandomBytes, encodeCrock } from "../../index.js";
|
||||
import { checkDbInvariant } from "../../util/invariants";
|
||||
import { checkDbInvariant } from "../../util/invariants.js";
|
||||
import { GetReadOnlyAccess } from "../../util/query.js";
|
||||
import { InternalWalletState } from "../state";
|
||||
import { InternalWalletState } from "../state.js";
|
||||
|
||||
export async function provideBackupState(
|
||||
ws: InternalWalletState,
|
||||
|
@ -14,16 +14,16 @@
|
||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
import { kdf } from "../crypto/primitives/kdf";
|
||||
import { kdf } from "../crypto/primitives/kdf.js";
|
||||
import {
|
||||
encodeCrock,
|
||||
getRandomBytes,
|
||||
stringToBytes,
|
||||
} from "../crypto/talerCrypto";
|
||||
import { selectPayCoins } from "../util/coinSelection";
|
||||
} from "../crypto/talerCrypto.js";
|
||||
import { selectPayCoins } from "../util/coinSelection.js";
|
||||
import { canonicalJson } from "@gnu-taler/taler-util";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http.js";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
|
||||
import {
|
||||
Amounts,
|
||||
buildCodecForObject,
|
||||
@ -53,8 +53,8 @@ import {
|
||||
getCandidatePayCoins,
|
||||
getEffectiveDepositAmount,
|
||||
getTotalPaymentCost,
|
||||
} from "./pay";
|
||||
import { InternalWalletState } from "./state";
|
||||
} from "./pay.js";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { DepositGroupRecord } from "../db.js";
|
||||
|
||||
|
@ -47,15 +47,6 @@ import {
|
||||
WireInfo,
|
||||
WalletStoresV1,
|
||||
} from "../db.js";
|
||||
import {
|
||||
URL,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
getExpiryTimestamp,
|
||||
readSuccessResponseTextOrThrow,
|
||||
encodeCrock,
|
||||
hash,
|
||||
decodeCrock,
|
||||
} from "../index.js";
|
||||
import { j2s, canonicalizeBaseUrl } from "@gnu-taler/taler-util";
|
||||
import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries.js";
|
||||
import {
|
||||
@ -69,9 +60,11 @@ import {
|
||||
WALLET_CACHE_BREAKER_CLIENT_VERSION,
|
||||
WALLET_EXCHANGE_PROTOCOL_VERSION,
|
||||
} from "./versions.js";
|
||||
import { HttpRequestLibrary } from "../util/http.js";
|
||||
import { getExpiryTimestamp, HttpRequestLibrary, readSuccessResponseJsonOrThrow, readSuccessResponseTextOrThrow } from "../util/http.js";
|
||||
import { CryptoApi } from "../crypto/workers/cryptoApi.js";
|
||||
import { DbAccess, GetReadOnlyAccess } from "../util/query.js";
|
||||
import { decodeCrock, encodeCrock, hash } from "../crypto/talerCrypto.js";
|
||||
import { URL } from "../util/url.js";
|
||||
|
||||
const logger = new Logger("exchanges.ts");
|
||||
|
||||
|
@ -54,29 +54,6 @@ import {
|
||||
getDurationRemaining,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
|
||||
import {
|
||||
AbortStatus,
|
||||
AllowedAuditorInfo,
|
||||
AllowedExchangeInfo,
|
||||
CoinRecord,
|
||||
CoinStatus,
|
||||
DenominationRecord,
|
||||
getHttpResponseErrorDetails,
|
||||
guardOperationException,
|
||||
HttpResponseStatus,
|
||||
makeErrorDetails,
|
||||
OperationFailedAndReportedError,
|
||||
OperationFailedError,
|
||||
ProposalRecord,
|
||||
ProposalStatus,
|
||||
PurchaseRecord,
|
||||
readSuccessResponseJsonOrErrorCode,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
readTalerErrorResponse,
|
||||
throwUnexpectedRequestError,
|
||||
URL,
|
||||
WalletContractData,
|
||||
} from "../index.js";
|
||||
import {
|
||||
PayCoinSelection,
|
||||
CoinCandidateSelection,
|
||||
@ -94,10 +71,35 @@ import { getTotalRefreshCost, createRefreshGroup } from "./refresh.js";
|
||||
import { InternalWalletState, EXCHANGE_COINS_LOCK } from "./state.js";
|
||||
import { ContractTermsUtil } from "../util/contractTerms.js";
|
||||
import { getExchangeDetails } from "./exchanges.js";
|
||||
import { DbAccess, GetReadWriteAccess } from "../util/query.js";
|
||||
import { WalletStoresV1 } from "../db.js";
|
||||
import { Wallet } from "../wallet.js";
|
||||
import { x25519_edwards_keyPair_fromSecretKey } from "../crypto/primitives/nacl-fast.js";
|
||||
import { GetReadWriteAccess } from "../util/query.js";
|
||||
import {
|
||||
AbortStatus,
|
||||
AllowedAuditorInfo,
|
||||
AllowedExchangeInfo,
|
||||
CoinRecord,
|
||||
CoinStatus,
|
||||
DenominationRecord,
|
||||
ProposalRecord,
|
||||
ProposalStatus,
|
||||
PurchaseRecord,
|
||||
WalletContractData,
|
||||
WalletStoresV1,
|
||||
} from "../db.js";
|
||||
import {
|
||||
getHttpResponseErrorDetails,
|
||||
HttpResponseStatus,
|
||||
readSuccessResponseJsonOrErrorCode,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
readTalerErrorResponse,
|
||||
throwUnexpectedRequestError,
|
||||
} from "../util/http.js";
|
||||
import {
|
||||
guardOperationException,
|
||||
makeErrorDetails,
|
||||
OperationFailedAndReportedError,
|
||||
OperationFailedError,
|
||||
} from "./errors.js";
|
||||
import { URL } from "../util/url.js";
|
||||
|
||||
/**
|
||||
* Logger.
|
||||
|
@ -27,10 +27,10 @@ import {
|
||||
PendingOperationsResponse,
|
||||
PendingOperationType,
|
||||
ReserveType,
|
||||
} from "../pending-types";
|
||||
} from "../pending-types.js";
|
||||
import { getTimestampNow, Timestamp } from "@gnu-taler/taler-util";
|
||||
import { InternalWalletState } from "./state";
|
||||
import { getBalancesInsideTransaction } from "./balance";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import { getBalancesInsideTransaction } from "./balance.js";
|
||||
import { GetReadOnlyAccess } from "../util/query.js";
|
||||
|
||||
async function gatherExchangePending(
|
||||
|
@ -32,7 +32,7 @@ import {
|
||||
RefreshReason,
|
||||
TalerErrorDetails,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
|
||||
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto.js";
|
||||
import {
|
||||
CoinRecord,
|
||||
CoinSourceType,
|
||||
@ -44,14 +44,14 @@ import {
|
||||
WalletStoresV1,
|
||||
} from "../db.js";
|
||||
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http.js";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
|
||||
import { URL } from "../util/url";
|
||||
import { guardOperationException } from "./errors";
|
||||
import { createRefreshGroup, processRefreshGroup } from "./refresh";
|
||||
import { getReserveRequestTimeout, processReserve } from "./reserves";
|
||||
import { InternalWalletState } from "./state";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
|
||||
import { URL } from "../util/url.js";
|
||||
import { guardOperationException } from "./errors.js";
|
||||
import { createRefreshGroup, processRefreshGroup } from "./refresh.js";
|
||||
import { getReserveRequestTimeout, processReserve } from "./reserves.js";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import { GetReadWriteAccess } from "../util/query.js";
|
||||
|
||||
const logger = new Logger("operations/recoup.ts");
|
||||
|
@ -14,7 +14,7 @@
|
||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto";
|
||||
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto.js";
|
||||
import {
|
||||
CoinRecord,
|
||||
CoinSourceType,
|
||||
@ -36,10 +36,10 @@ import {
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { AmountJson, Amounts } from "@gnu-taler/taler-util";
|
||||
import { amountToPretty } from "@gnu-taler/taler-util";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http";
|
||||
import { checkDbInvariant } from "../util/invariants";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http.js";
|
||||
import { checkDbInvariant } from "../util/invariants.js";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
|
||||
import {
|
||||
Duration,
|
||||
durationFromSpec,
|
||||
@ -51,14 +51,13 @@ import {
|
||||
timestampDifference,
|
||||
timestampMin,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { URL } from "../util/url";
|
||||
import { guardOperationException } from "./errors";
|
||||
import { updateExchangeFromUrl } from "./exchanges";
|
||||
import { EXCHANGE_COINS_LOCK, InternalWalletState } from "./state";
|
||||
import { isWithdrawableDenom, selectWithdrawalDenominations } from "./withdraw";
|
||||
import { URL } from "../util/url.js";
|
||||
import { guardOperationException } from "./errors.js";
|
||||
import { updateExchangeFromUrl } from "./exchanges.js";
|
||||
import { EXCHANGE_COINS_LOCK, InternalWalletState } from "./state.js";
|
||||
import { isWithdrawableDenom, selectWithdrawalDenominations } from "./withdraw.js";
|
||||
import { RefreshNewDenomInfo } from "../crypto/cryptoTypes.js";
|
||||
import { GetReadWriteAccess } from "../util/query.js";
|
||||
import { Wallet } from "../wallet.js";
|
||||
|
||||
const logger = new Logger("refresh.ts");
|
||||
|
||||
|
@ -23,12 +23,10 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { InternalWalletState } from "./state";
|
||||
import { guardOperationException } from "./errors";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import { guardOperationException } from "./errors.js";
|
||||
import {
|
||||
getTimestampNow,
|
||||
Timestamp,
|
||||
durationAdd,
|
||||
timestampAddDuration,
|
||||
TalerErrorDetails,
|
||||
AbortingCoin,
|
||||
@ -47,10 +45,10 @@ import {
|
||||
RefreshReason,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http";
|
||||
import { URL } from "../util/url";
|
||||
import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries";
|
||||
import { checkDbInvariant } from "../util/invariants";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http.js";
|
||||
import { URL } from "../util/url.js";
|
||||
import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries.js";
|
||||
import { checkDbInvariant } from "../util/invariants.js";
|
||||
import { TalerErrorCode } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
PurchaseRecord,
|
||||
@ -62,7 +60,6 @@ import {
|
||||
} from "../db.js";
|
||||
import { getTotalRefreshCost, createRefreshGroup } from "./refresh.js";
|
||||
import { GetReadWriteAccess } from "../util/query.js";
|
||||
import { Wallet } from "../wallet.js";
|
||||
|
||||
const logger = new Logger("refund.ts");
|
||||
|
||||
|
@ -22,16 +22,12 @@ import {
|
||||
BalancesResponse,
|
||||
Logger,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { CryptoApi, CryptoWorkerFactory } from "../crypto/workers/cryptoApi.js";
|
||||
import { WalletStoresV1 } from "../db.js";
|
||||
import {
|
||||
CryptoApi,
|
||||
OpenedPromise,
|
||||
CryptoWorkerFactory,
|
||||
openPromise,
|
||||
} from "../index.js";
|
||||
import { PendingOperationsResponse } from "../pending-types.js";
|
||||
import { AsyncOpMemoMap, AsyncOpMemoSingle } from "../util/asyncMemo.js";
|
||||
import { HttpRequestLibrary } from "../util/http";
|
||||
import { OpenedPromise, openPromise } from "../util/promiseUtils.js";
|
||||
import { DbAccess } from "../util/query.js";
|
||||
|
||||
type NotificationListener = (n: WalletNotification) => void;
|
||||
|
@ -22,7 +22,7 @@ import {
|
||||
HttpRequestLibrary,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
checkSuccessResponseOrThrow,
|
||||
} from "../util/http";
|
||||
} from "../util/http.js";
|
||||
import {
|
||||
AmountString,
|
||||
codecForAny,
|
||||
@ -33,10 +33,10 @@ import {
|
||||
TestPayArgs,
|
||||
PreparePayResultType,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { URL } from "../index.js";
|
||||
import { Wallet } from "../wallet.js";
|
||||
import { createTalerWithdrawReserve } from "./reserves.js";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import { URL } from "../util/url.js";
|
||||
|
||||
const logger = new Logger("operations/testing.ts");
|
||||
|
||||
|
@ -37,19 +37,12 @@ import {
|
||||
CoinSourceType,
|
||||
CoinStatus,
|
||||
} from "../db.js";
|
||||
import {
|
||||
URL,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
encodeCrock,
|
||||
getRandomBytes,
|
||||
getHttpResponseErrorDetails,
|
||||
} from "../index.js";
|
||||
import { j2s } from "@gnu-taler/taler-util";
|
||||
import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js";
|
||||
import { initRetryInfo, updateRetryInfoTimeout } from "../util/retries.js";
|
||||
import { guardOperationException, makeErrorDetails } from "./errors.js";
|
||||
import { updateExchangeFromUrl } from "./exchanges.js";
|
||||
import { InternalWalletState } from "./state";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import {
|
||||
getExchangeWithdrawalInfo,
|
||||
updateWithdrawalDenoms,
|
||||
@ -57,6 +50,12 @@ import {
|
||||
selectWithdrawalDenominations,
|
||||
denomSelectionInfoToState,
|
||||
} from "./withdraw.js";
|
||||
import { URL } from "../util/url.js";
|
||||
import {
|
||||
getHttpResponseErrorDetails,
|
||||
readSuccessResponseJsonOrThrow,
|
||||
} from "../util/http.js";
|
||||
import { encodeCrock, getRandomBytes } from "../crypto/talerCrypto.js";
|
||||
|
||||
const logger = new Logger("operations/tip.ts");
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { InternalWalletState } from "./state";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import {
|
||||
WalletRefundItem,
|
||||
RefundState,
|
||||
@ -36,7 +36,7 @@ import {
|
||||
WithdrawalDetails,
|
||||
OrderShortInfo,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { getFundingPaytoUris } from "./reserves";
|
||||
import { getFundingPaytoUris } from "./reserves.js";
|
||||
import { getExchangeDetails } from "./exchanges.js";
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
import { Amounts } from "@gnu-taler/taler-util";
|
||||
import test from "ava";
|
||||
import { DenominationRecord, DenominationStatus } from "../db.js";
|
||||
import { selectWithdrawalDenominations } from "./withdraw";
|
||||
import { selectWithdrawalDenominations } from "./withdraw.js";
|
||||
|
||||
test("withdrawal selection bug repro", (t) => {
|
||||
const amount = {
|
||||
|
@ -35,7 +35,7 @@ import {
|
||||
DenomSelectionState,
|
||||
ExchangeRecord,
|
||||
ExchangeDetailsRecord,
|
||||
} from "../db";
|
||||
} from "../db.js";
|
||||
import {
|
||||
BankWithdrawDetails,
|
||||
TalerErrorDetails,
|
||||
@ -48,20 +48,20 @@ import {
|
||||
WithdrawResponse,
|
||||
codecForTalerConfigResponse,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { InternalWalletState } from "./state";
|
||||
import { InternalWalletState } from "./state.js";
|
||||
import { Logger } from "@gnu-taler/taler-util";
|
||||
import { getExchangeDetails, updateExchangeFromUrl } from "./exchanges";
|
||||
import { getExchangeDetails, updateExchangeFromUrl } from "./exchanges.js";
|
||||
import {
|
||||
WALLET_EXCHANGE_PROTOCOL_VERSION,
|
||||
WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
|
||||
} from "./versions";
|
||||
} from "./versions.js";
|
||||
|
||||
import * as LibtoolVersion from "@gnu-taler/taler-util";
|
||||
import {
|
||||
guardOperationException,
|
||||
makeErrorDetails,
|
||||
OperationFailedError,
|
||||
} from "./errors";
|
||||
} from "./errors.js";
|
||||
import { NotificationType } from "@gnu-taler/taler-util";
|
||||
import {
|
||||
getTimestampNow,
|
||||
@ -69,10 +69,10 @@ import {
|
||||
timestampCmp,
|
||||
timestampSubtractDuraction,
|
||||
} from "@gnu-taler/taler-util";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http";
|
||||
import { URL } from "../util/url";
|
||||
import { readSuccessResponseJsonOrThrow } from "../util/http.js";
|
||||
import { URL } from "../util/url.js";
|
||||
import { TalerErrorCode } from "@gnu-taler/taler-util";
|
||||
import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries";
|
||||
import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries.js";
|
||||
import { compare } from "@gnu-taler/taler-util";
|
||||
import { walletCoreDebugFlags } from "../util/debugFlags.js";
|
||||
import { getExchangeTrust } from "./currencies.js";
|
||||
|
@ -17,9 +17,9 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import test from "ava";
|
||||
import { AmountJson, Amounts } from "@gnu-taler/taler-util";
|
||||
import test from "ava";
|
||||
import { AvailableCoinInfo, selectPayCoins } from "./coinSelection";
|
||||
import { AvailableCoinInfo, selectPayCoins } from "./coinSelection.js";
|
||||
|
||||
function a(x: string): AmountJson {
|
||||
const amt = Amounts.parse(x);
|
||||
|
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { AmountJson, AmountLike, Amounts } from "@gnu-taler/taler-util";
|
||||
import { AmountJson, Amounts } from "@gnu-taler/taler-util";
|
||||
import { strcmp, Logger } from "@gnu-taler/taler-util";
|
||||
|
||||
const logger = new Logger("coinSelection.ts");
|
||||
|
@ -24,7 +24,7 @@
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
import { OperationFailedError, makeErrorDetails } from "../operations/errors";
|
||||
import { OperationFailedError, makeErrorDetails } from "../operations/errors.js";
|
||||
import {
|
||||
Logger,
|
||||
Duration,
|
||||
|
@ -23,7 +23,7 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
import { openPromise } from "./promiseUtils";
|
||||
import { openPromise } from "./promiseUtils.js";
|
||||
import {
|
||||
IDBRequest,
|
||||
IDBTransaction,
|
||||
@ -31,7 +31,6 @@ import {
|
||||
IDBDatabase,
|
||||
IDBFactory,
|
||||
IDBVersionChangeEvent,
|
||||
Event,
|
||||
IDBCursor,
|
||||
IDBKeyPath,
|
||||
} from "@gnu-taler/idb-bridge";
|
||||
|
@ -46,6 +46,7 @@ importers:
|
||||
'@types/node': ^14.14.22
|
||||
ava: ^3.15.0
|
||||
esbuild: ^0.9.2
|
||||
esm: ^3.2.25
|
||||
jed: ^1.1.1
|
||||
prettier: ^2.2.1
|
||||
rimraf: ^3.0.2
|
||||
@ -58,6 +59,7 @@ importers:
|
||||
'@types/node': 14.14.34
|
||||
ava: 3.15.0
|
||||
esbuild: 0.9.2
|
||||
esm: 3.2.25
|
||||
prettier: 2.2.1
|
||||
rimraf: 3.0.2
|
||||
typescript: 4.2.3
|
||||
@ -6163,7 +6165,7 @@ packages:
|
||||
/axios/0.21.1:
|
||||
resolution: {integrity: sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==}
|
||||
dependencies:
|
||||
follow-redirects: 1.14.0_debug@4.3.1
|
||||
follow-redirects: 1.14.0
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
@ -9658,6 +9660,15 @@ packages:
|
||||
readable-stream: 2.3.7
|
||||
dev: true
|
||||
|
||||
/follow-redirects/1.14.0:
|
||||
resolution: {integrity: sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==}
|
||||
engines: {node: '>=4.0'}
|
||||
peerDependencies:
|
||||
debug: '*'
|
||||
peerDependenciesMeta:
|
||||
debug:
|
||||
optional: true
|
||||
|
||||
/follow-redirects/1.14.0_debug@4.3.1:
|
||||
resolution: {integrity: sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==}
|
||||
engines: {node: '>=4.0'}
|
||||
@ -9668,6 +9679,7 @@ packages:
|
||||
optional: true
|
||||
dependencies:
|
||||
debug: 4.3.1_supports-color@6.1.0
|
||||
dev: true
|
||||
|
||||
/for-each/0.3.3:
|
||||
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
|
||||
|
Loading…
Reference in New Issue
Block a user