Skip to content

Commit 17996c0

Browse files
authored
Merge branch 'master' into markm-test-w-some-endo-2
2 parents 9607cad + c4f6a03 commit 17996c0

File tree

7 files changed

+34
-30
lines changed

7 files changed

+34
-30
lines changed

MAINTAINERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ For each set of changes to include:
117117

118118
These are the steps for a Release Manager to create and publish a
119119
new release of the Agoric SDK. This combines the process of
120-
GitHub-based release managment and publication together with NPM-based
120+
GitHub-based release management and publication together with NPM-based
121121
publication of the SDK and its individual packages.
122122

123123
### Prerequisites

docs/architecture/0001-record-architecture-decisions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ subject](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-deci
1111

1212
Architecture for agile projects has to be described and defined differently. Not all decisions will be made at once, nor will all of them be done when the project begins.
1313

14-
Agile methods are not opposed to documentation, only to valueless documentation. Documents that assist the team itself can have value, but only if they are kept up to date. Large documents are never kept up to date. Small, modular documents have at least a chance at being updated.
14+
Agile methods are not opposed to documentation, only to valueless documentation. Documents that assist the team itself can have value, but only if they are kept up to date. Large documents are never kept up to date. Small, modular documents have at least a chance of being updated.
1515

1616
Nobody ever reads large documents, either. Most developers have been on at least one project where the specification document was larger (in bytes) than the total source code size. Those documents are too large to open, read, or update. Bite sized pieces are easier for for all stakeholders to consume.
1717

docs/typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# usage of TypeScript
22

3-
Our use of TypeScript has to accomodate both .js development in agoric-sdk (which could not import types until TS 5.5) and .ts development of consumers of agoric-sdk packages (which could always import types). For .js development, we have many ambient (global) types so that we don't have to precede each type reference by an import. For .ts development, we want exports from modules so we don't pollute a global namespace. We are slowly transitioning away from ambient types.
3+
Our use of TypeScript has to accommodate both .js development in agoric-sdk (which could not import types until TS 5.5) and .ts development of consumers of agoric-sdk packages (which could always import types). For .js development, we have many ambient (global) types so that we don't have to precede each type reference by an import. For .ts development, we want exports from modules so we don't pollute a global namespace. We are slowly transitioning away from ambient types.
44

55
## Best practices
66

packages/orchestration/src/examples/swapExample.contract.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { withOrchestration } from '../utils/start-helper.js';
2626
* @param {Amount<'nat'>} offerArgs.staked
2727
* @param {CosmosValidatorAddress} offerArgs.validator
2828
*/
29-
const stackAndSwapFn = async (orch, { localTransfer }, seat, offerArgs) => {
29+
const stakeAndSwapFn = async (orch, { localTransfer }, seat, offerArgs) => {
3030
const { give } = seat.getProposal();
3131

3232
const omni = await orch.getChain('omniflixhub');
@@ -52,12 +52,12 @@ const stackAndSwapFn = async (orch, { localTransfer }, seat, offerArgs) => {
5252
slippage: 0.03,
5353
});
5454

55-
await localAccount
56-
.transferSteps(give.Stable, transferMsg)
57-
.then(_txResult =>
58-
omniAccount.delegate(offerArgs.validator, offerArgs.staked),
59-
)
60-
.catch(e => console.error(e));
55+
try {
56+
await localAccount.transferSteps(give.Stable, transferMsg);
57+
await omniAccount.delegate(offerArgs.validator, offerArgs.staked);
58+
} catch (e) {
59+
console.error(e);
60+
}
6161
};
6262

6363
/** @type {ContractMeta<typeof start>} */
@@ -105,7 +105,7 @@ const contract = async (zcf, privateArgs, zone, { orchestrate, zoeTools }) => {
105105
const swapAndStakeHandler = orchestrate(
106106
'LSTTia',
107107
{ zcf, localTransfer: zoeTools.localTransfer },
108-
stackAndSwapFn,
108+
stakeAndSwapFn,
109109
);
110110

111111
const publicFacet = zone.exo('publicFacet', undefined, {

packages/swingset-runner/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ FLAGS may be:
4949
--initonly - initialize the swingset but exit without running it
5050
--sqlite - runs using Sqlite3 as the data store (default)
5151
--memdb - runs using the non-persistent in-memory data store
52-
--usexs - run vats using the the XS engine
52+
--usexs - run vats using the XS engine
5353
--usebundlecache - cache bundles created by swingset loader
5454
--dbdir DIR - specify where the data store should go (default BASEDIR)
5555
--blockmode - run in block mode (checkpoint every BLOCKSIZE blocks)

packages/vow/src/when.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,26 @@ export const makeWhen = (
3636
if (seenPayloads.has(vowV0)) {
3737
throw Error('Vow resolution cycle detected');
3838
}
39-
result = await basicE(vowV0)
40-
.shorten()
41-
.then(
42-
res => {
43-
seenPayloads.add(vowV0);
44-
priorRetryValue = undefined;
45-
return res;
46-
},
47-
e => {
48-
const nextValue = isRetryableReason(e, priorRetryValue);
49-
if (nextValue) {
50-
// Shorten the same specimen to try again.
51-
priorRetryValue = nextValue;
52-
return result;
53-
}
54-
throw e;
55-
},
56-
);
39+
40+
try {
41+
// Shorten the vow to the "next step", whether another vow or a final
42+
// result.
43+
const res = await basicE(vowV0).shorten();
44+
45+
// Prevent cycles in the resolution graph.
46+
seenPayloads.add(vowV0);
47+
priorRetryValue = undefined;
48+
result = res;
49+
} catch (e) {
50+
const nextRetryValue = isRetryableReason(e, priorRetryValue);
51+
if (!nextRetryValue) {
52+
// Not a retry, so just reject with the reason.
53+
throw e;
54+
}
55+
56+
// Shorten the same specimen to try again.
57+
priorRetryValue = nextRetryValue;
58+
}
5759
// Advance to the next vow.
5860
payload = getVowPayload(result);
5961
}

scripts/registry.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ integrationTest() {
104104
# Install the Agoric CLI on this machine's $PATH.
105105
case $1 in
106106
link-cli | link-cli/*)
107+
# Prevent retries from failing with "must not already exist"
108+
rm -f "$HOME/bin/agoric"
107109
yarn link-cli "$HOME/bin/agoric"
108110
persistVar AGORIC_CMD "[\"$HOME/bin/agoric\"]"
109111
;;

0 commit comments

Comments
 (0)