From e6c0689806e8dd7b5f7885be92ddf00f6e09c41e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 9 Aug 2023 19:43:11 +0200 Subject: [PATCH] embedded: expose anastasis reducer for testing --- .../taler-wallet-embedded/src/wallet-qjs.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts b/packages/taler-wallet-embedded/src/wallet-qjs.ts index 278a90c83..7958fe90d 100644 --- a/packages/taler-wallet-embedded/src/wallet-qjs.ts +++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts @@ -49,9 +49,7 @@ import { mergeDiscoveryAggregate, ReducerState, } from "@gnu-taler/anastasis-core"; -import { - userIdentifierDerive, -} from "@gnu-taler/anastasis-core/lib/crypto.js"; +import { userIdentifierDerive } from "@gnu-taler/anastasis-core/lib/crypto.js"; setGlobalLogLevelFromString("trace"); @@ -335,13 +333,15 @@ export async function testArgon2id() { }, input_server_salt: "FZ48EFS7WS3R2ZR4V53A3GFFY4", output_id: - "YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18", + "YS45R6CGJV84K1NN7T14ZBCPVTZ6H15XJSM1FV0R748MHPV82SM0126EBZKBAAGCR34Q9AFKPEW1HRT2Q9GQ5JRA3642AB571DKZS18", }; - if (await userIdentifierDerive( - userIdVector.input_id_data, - userIdVector.input_server_salt, - ) != userIdVector.output_id) { + if ( + (await userIdentifierDerive( + userIdVector.input_id_data, + userIdVector.input_server_salt, + )) != userIdVector.output_id + ) { throw Error("argon2id is not working!"); } @@ -354,4 +354,5 @@ globalThis.testWithGv = testWithGv; globalThis.testWithLocal = testWithLocal; // @ts-ignore globalThis.testArgon2id = testArgon2id; - +// @ts-ignore +globalThis.testReduceAction = reduceAction;