diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/exchanges.ts | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts index 1fce92caf..d9051b32f 100644 --- a/packages/taler-wallet-core/src/operations/exchanges.ts +++ b/packages/taler-wallet-core/src/operations/exchanges.ts @@ -63,7 +63,7 @@ import { ExchangeRecord, WalletStoresV1, } from "../db.js"; -import { isWithdrawableDenom, TalerCryptoInterface } from "../index.js"; +import { isWithdrawableDenom } from "../index.js"; import { InternalWalletState, TrustInfo } from "../internal-wallet-state.js"; import { checkDbInvariant } from "../util/invariants.js"; import { @@ -236,25 +236,12 @@ export async function acceptExchangeTermsOfService( }); } -export interface ValidateWireInfoArgs { - cryptoApi: TalerCryptoInterface; - - /** - * Exchange major protocol version. - */ - versionCurrent?: number; - - wireInfo: ExchangeWireJson; - - insecureTrustExchange?: boolean; - - masterPublicKey: string; -} - -export async function validateWireInfo( - args: ValidateWireInfoArgs, +async function validateWireInfo( + ws: InternalWalletState, + versionCurrent: number, + wireInfo: ExchangeWireJson, + masterPublicKey: string, ): Promise<WireInfo> { - const { wireInfo, masterPublicKey, insecureTrustExchange } = args; for (const a of wireInfo.accounts) { logger.trace("validating exchange acct"); let isValid = false; @@ -645,11 +632,6 @@ export async function updateExchangeFromUrlHandler( throw Error("unexpected invalid version"); } - if (wireInfoDownload.master_public_key != keysInfo.masterPublicKey) { - // FIXME: introduce error code - throw Error("inconsistent master public key between /keys and /wire"); - } - const wireInfo = await validateWireInfo( ws, version.current, |