Skip to content

Commit

Permalink
Merge branch 'master' into markm-test-w-some-endo-2
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored Jul 22, 2024
2 parents 9607cad + c4f6a03 commit 17996c0
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ For each set of changes to include:

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

### Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/0001-record-architecture-decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ subject](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-deci

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.

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.
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.

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.

Expand Down
2 changes: 1 addition & 1 deletion docs/typescript.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# usage of TypeScript

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.
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.

## Best practices

Expand Down
16 changes: 8 additions & 8 deletions packages/orchestration/src/examples/swapExample.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { withOrchestration } from '../utils/start-helper.js';
* @param {Amount<'nat'>} offerArgs.staked
* @param {CosmosValidatorAddress} offerArgs.validator
*/
const stackAndSwapFn = async (orch, { localTransfer }, seat, offerArgs) => {
const stakeAndSwapFn = async (orch, { localTransfer }, seat, offerArgs) => {
const { give } = seat.getProposal();

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

await localAccount
.transferSteps(give.Stable, transferMsg)
.then(_txResult =>
omniAccount.delegate(offerArgs.validator, offerArgs.staked),
)
.catch(e => console.error(e));
try {
await localAccount.transferSteps(give.Stable, transferMsg);
await omniAccount.delegate(offerArgs.validator, offerArgs.staked);
} catch (e) {
console.error(e);
}
};

/** @type {ContractMeta<typeof start>} */
Expand Down Expand Up @@ -105,7 +105,7 @@ const contract = async (zcf, privateArgs, zone, { orchestrate, zoeTools }) => {
const swapAndStakeHandler = orchestrate(
'LSTTia',
{ zcf, localTransfer: zoeTools.localTransfer },
stackAndSwapFn,
stakeAndSwapFn,
);

const publicFacet = zone.exo('publicFacet', undefined, {
Expand Down
2 changes: 1 addition & 1 deletion packages/swingset-runner/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ FLAGS may be:
--initonly - initialize the swingset but exit without running it
--sqlite - runs using Sqlite3 as the data store (default)
--memdb - runs using the non-persistent in-memory data store
--usexs - run vats using the the XS engine
--usexs - run vats using the XS engine
--usebundlecache - cache bundles created by swingset loader
--dbdir DIR - specify where the data store should go (default BASEDIR)
--blockmode - run in block mode (checkpoint every BLOCKSIZE blocks)
Expand Down
38 changes: 20 additions & 18 deletions packages/vow/src/when.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,26 @@ export const makeWhen = (
if (seenPayloads.has(vowV0)) {
throw Error('Vow resolution cycle detected');
}
result = await basicE(vowV0)
.shorten()
.then(
res => {
seenPayloads.add(vowV0);
priorRetryValue = undefined;
return res;
},
e => {
const nextValue = isRetryableReason(e, priorRetryValue);
if (nextValue) {
// Shorten the same specimen to try again.
priorRetryValue = nextValue;
return result;
}
throw e;
},
);

try {
// Shorten the vow to the "next step", whether another vow or a final
// result.
const res = await basicE(vowV0).shorten();

// Prevent cycles in the resolution graph.
seenPayloads.add(vowV0);
priorRetryValue = undefined;
result = res;
} catch (e) {
const nextRetryValue = isRetryableReason(e, priorRetryValue);
if (!nextRetryValue) {
// Not a retry, so just reject with the reason.
throw e;
}

// Shorten the same specimen to try again.
priorRetryValue = nextRetryValue;
}
// Advance to the next vow.
payload = getVowPayload(result);
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ integrationTest() {
# Install the Agoric CLI on this machine's $PATH.
case $1 in
link-cli | link-cli/*)
# Prevent retries from failing with "must not already exist"
rm -f "$HOME/bin/agoric"
yarn link-cli "$HOME/bin/agoric"
persistVar AGORIC_CMD "[\"$HOME/bin/agoric\"]"
;;
Expand Down

0 comments on commit 17996c0

Please sign in to comment.