[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: wallet-core-embedded: added A
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: wallet-core-embedded: added Anastasis policy discovery |
Date: |
Wed, 09 Aug 2023 19:43:29 +0200 |
This is an automated email from the git hooks/post-receive script.
ivan-avalos pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new d33b70b06 wallet-core-embedded: added Anastasis policy discovery
d33b70b06 is described below
commit d33b70b06940315510ee2c97ced62a8c377fad07
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Mon Aug 7 11:14:00 2023 +0200
wallet-core-embedded: added Anastasis policy discovery
---
packages/taler-wallet-embedded/src/wallet-qjs.ts | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts
b/packages/taler-wallet-embedded/src/wallet-qjs.ts
index 04efb458a..278a90c83 100644
--- a/packages/taler-wallet-embedded/src/wallet-qjs.ts
+++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts
@@ -45,6 +45,8 @@ import {
reduceAction,
getBackupStartState,
getRecoveryStartState,
+ discoverPolicies,
+ mergeDiscoveryAggregate,
ReducerState,
} from "@gnu-taler/anastasis-core";
import {
@@ -195,18 +197,33 @@ async function handleAnastasisRequest(
};
};
+ let req = args ?? {};
+
switch (operation) {
case "anastasisReduce":
// TODO: do some input validation here
- let req = args ?? {};
- let res = await reduceAction(req.state, req.action, req.args ?? {});
+ let reduceRes = await reduceAction(req.state, req.action, req.args ??
{});
// For now, this will return "success" even if the wrapped Anastasis
// response is a ReducerStateError.
- return wrapSuccessResponse(res);
+ return wrapSuccessResponse(reduceRes);
case "anastasisStartBackup":
return wrapSuccessResponse(await getBackupStartState());
case "anastasisStartRecovery":
return wrapSuccessResponse(await getRecoveryStartState());
+ case "anastasisDiscoverPolicies":
+ let discoverRes = await discoverPolicies(req.state, req.cursor);
+ let aggregatedPolicies = mergeDiscoveryAggregate(
+ discoverRes.policies ?? [],
+ req.state.discoveryState?.aggregatedPolicies ?? [],
+ );
+ return wrapSuccessResponse({
+ ...req.state,
+ discoveryState: {
+ state: "finished",
+ aggregatedPolicies,
+ cursor: discoverRes.cursor,
+ },
+ });
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: wallet-core-embedded: added Anastasis policy discovery,
gnunet <=