@agoric/client-utils 0.1.1-dev-02967de.0 → 0.1.1-dev-7e54272.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/client-utils",
3
- "version": "0.1.1-dev-02967de.0+02967de",
3
+ "version": "0.1.1-dev-7e54272.0+7e54272",
4
4
  "description": "Utilities for building Agoric clients",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -27,11 +27,11 @@
27
27
  "ts-blank-space": "^0.4.1"
28
28
  },
29
29
  "dependencies": {
30
- "@agoric/casting": "0.4.3-dev-02967de.0+02967de",
31
- "@agoric/ertp": "0.16.3-dev-02967de.0+02967de",
32
- "@agoric/internal": "0.3.3-dev-02967de.0+02967de",
33
- "@agoric/smart-wallet": "0.5.4-dev-02967de.0+02967de",
34
- "@agoric/vats": "0.15.2-dev-02967de.0+02967de",
30
+ "@agoric/casting": "0.4.3-dev-7e54272.0+7e54272",
31
+ "@agoric/ertp": "0.16.3-dev-7e54272.0+7e54272",
32
+ "@agoric/internal": "0.3.3-dev-7e54272.0+7e54272",
33
+ "@agoric/smart-wallet": "0.5.4-dev-7e54272.0+7e54272",
34
+ "@agoric/vats": "0.15.2-dev-7e54272.0+7e54272",
35
35
  "@cosmjs/stargate": "^0.32.3",
36
36
  "@cosmjs/tendermint-rpc": "^0.32.3",
37
37
  "@endo/common": "^1.2.8",
@@ -58,5 +58,5 @@
58
58
  ],
59
59
  "timeout": "20m"
60
60
  },
61
- "gitHead": "02967de672887513c78a98565e95b2932f165863"
61
+ "gitHead": "7e54272bf8e809a106caf58549e409f33f1fce63"
62
62
  }
package/src/sync-tools.js CHANGED
@@ -18,6 +18,7 @@
18
18
  * @property {number} [maxRetries]
19
19
  * @property {number} [retryIntervalMs]
20
20
  * @property {boolean} [reusePromise]
21
+ * @property {(value: unknown) => unknown} [renderResult]
21
22
  *
22
23
  * @typedef {RetryOptions & {errorMessage: string}} WaitUntilOptions
23
24
  *
@@ -56,12 +57,13 @@ export const retryUntilCondition = async (
56
57
  maxRetries = 6,
57
58
  retryIntervalMs = 3500,
58
59
  reusePromise = false,
60
+ renderResult = x => x,
59
61
  // XXX mixes ocaps with configuration options
60
62
  log = console.log,
61
63
  setTimeout,
62
64
  },
63
65
  ) => {
64
- console.log({ maxRetries, retryIntervalMs, reusePromise, message });
66
+ console.log({ maxRetries, retryIntervalMs, message });
65
67
 
66
68
  await null; // separate sync prologue
67
69
 
@@ -93,7 +95,7 @@ export const retryUntilCondition = async (
93
95
  log(`Attempt ${retries + 1} timed out`);
94
96
  if (!reusePromise) resultP = undefined;
95
97
  } else {
96
- log('RESULT', result);
98
+ log('RESULT', renderResult(result));
97
99
  if (condition(result)) {
98
100
  return result;
99
101
  }