Skip to content

Commit

Permalink
Merge branch 'master' into ta/fix-proto-symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 10, 2022
2 parents 194be4a + 416b3e7 commit 6728cd4
Show file tree
Hide file tree
Showing 264 changed files with 89 additions and 556 deletions.
3 changes: 2 additions & 1 deletion packages/SwingSet/src/lib/storageAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export function makeBufferedStorage(kvStore, listeners = {}) {
if (additions.has(key)) return additions.get(key);
if (deletions.has(key)) return undefined;
const value = kvStore.get(key);
// @ts-expect-error value may be undefined
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620
// @ts-ignore value may be undefined
if (onGet !== undefined) onGet(key, value);
return value;
},
Expand Down
8 changes: 1 addition & 7 deletions packages/casting/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
"compilerOptions": {
"target": "esnext",
"module": "esnext",

"checkJs": true,
"noEmit": true,
/*
// The following flags are for creating .d.ts files:
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
*/
"downlevelIteration": true,
"strictNullChecks": true,
"moduleResolution": "node",
Expand Down
1 change: 1 addition & 0 deletions packages/casting/node-fetch-shim.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global globalThis */
import fetch from 'node-fetch';

// @ts-expect-error node-fetch does not exactly match W3C Fetch
globalThis.fetch = fetch;
1 change: 1 addition & 0 deletions packages/casting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"devDependencies": {
"@endo/ses-ava": "^0.2.35",
"@types/node-fetch": "^2.6.2",
"ava": "^5.0.1",
"c8": "^7.7.2",
"express": "^4.17.1",
Expand Down
1 change: 0 additions & 1 deletion packages/casting/src/casting-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ export const makeCastingSpec = async sourceP => {
}
assert.fail(`CastingSpec ${spec} is not a string, object, or ref`);
};
/** @typedef {ReturnType<typeof makeCastingSpec>} CastingSpec */
12 changes: 5 additions & 7 deletions packages/casting/src/follower-cosmjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const { Tendermint34Client } = tendermintRpcStar;
const { details: X, quote: q } = assert;
const textDecoder = new TextDecoder();

/** @template T @typedef {import('./types.js').StreamCell<T>} StreamCell */
/** @template T @typedef {import('./types.js').ValueFollowerElement<T>} ValueFollowerElement */
/** @template T @typedef {import('./types.js').Follower<ValueFollowerElement<T>>} ValueFollower */
/** @template T @typedef {import('./types.js').Follower<import('./types.js').ValueFollowerElement<T>>} ValueFollower */

/**
* This is an imperfect heuristic to navigate the migration from value cells to
Expand Down Expand Up @@ -341,7 +339,7 @@ export const makeCosmjsFollower = (
* @param {any} data
* @param {number} blockHeight
* @param {number} currentBlockHeight
* @returns {Promise<ValueFollowerElement<T>>}
* @returns {Promise<import('./types.js').ValueFollowerElement<T>>}
*/
const followerElementFromStreamCellValue = async (
data,
Expand All @@ -356,7 +354,7 @@ export const makeCosmjsFollower = (
};

/**
* @param {StreamCell<T>} streamCell
* @param {import('./types.js').StreamCell<T>} streamCell
* @param {number} currentBlockHeight
* @yields {ValueFollowerElement<T>}
*/
Expand All @@ -371,7 +369,7 @@ export const makeCosmjsFollower = (
}

/**
* @param {StreamCell<T>} streamCell
* @param {import('./types.js').StreamCell<T>} streamCell
* @param {number} currentBlockHeight
* @yields {ValueFollowerElement<T>}
*/
Expand All @@ -386,7 +384,7 @@ export const makeCosmjsFollower = (
}

/**
* @param {StreamCell<T>} streamCell
* @param {import('./types.js').StreamCell<T>} streamCell
* @param {number} currentBlockHeight
* @yields {ValueFollowerElement<T>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/casting/src/leader-netconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ export const makeLeader = (bootstrap = DEFAULT_BOOTSTRAP, options) => {
}
return makeLeaderFromRpcAddresses([bootstrap], options);
};
/** @typedef {ReturnType<typeof makeLeader>} Leader */
8 changes: 1 addition & 7 deletions packages/deploy-script-support/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
"compilerOptions": {
"target": "esnext",
"module": "esnext",

"checkJs": true,
"noEmit": true,
/*
// The following flags are for creating .d.ts files:
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
*/
"downlevelIteration": true,
"strictNullChecks": true,
"moduleResolution": "node",
Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/assertOfferResult.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { assert, details as X } from '@agoric/assert';
import { E } from '@endo/far';

Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/code-gen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { makeMarshal } from '@endo/marshal';
import { decodeToJustin } from '@endo/marshal/src/marshal-justin.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/deploy-script-support/src/coreProposalBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const makeCoreProposalBehavior = ({
return fromEntries(ents);
};

/** @param {ChainBootstrapSpace} allPowers */
/** @param {ChainBootstrapSpace & BootstrapPowers & { evaluateInstallation: any }} allPowers */
const behavior = async allPowers => {
const {
consume: { board, agoricNamesAdmin },
Expand Down
2 changes: 0 additions & 2 deletions packages/deploy-script-support/src/depositInvitation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/far';

/**
Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/endo-pieces-contract.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { E, Far } from '@endo/far';
import { encodeBase64, decodeBase64 } from '@endo/base64';
import { ZipWriter } from '@endo/zip';
Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/extract-proposal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import fs from 'fs';
import { createRequire } from 'module';
import path from 'path';
Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/getBundlerMaker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
/**
* This helper mainly exists to bridge the gaps that would be filled by
* bundlecap support. It will probably go away after bundlecap support is
Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import '@agoric/zoe/exported.js';
import { E } from '@endo/far';

Expand Down
2 changes: 0 additions & 2 deletions packages/deploy-script-support/src/install.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import './externalTypes.js';

import { E } from '@endo/far';
Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/installInPieces.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { E } from '@endo/far';
import { ZipReader } from '@endo/zip';
import { encodeBase64, decodeBase64 } from '@endo/base64';
Expand Down
2 changes: 0 additions & 2 deletions packages/deploy-script-support/src/offer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/far';
import { assert } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
Expand Down
2 changes: 0 additions & 2 deletions packages/deploy-script-support/src/saveIssuer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/far';

/**
Expand Down
2 changes: 0 additions & 2 deletions packages/deploy-script-support/src/startInstance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { assert } from '@agoric/assert';
import { E, passStyleOf } from '@endo/far';

Expand Down
1 change: 0 additions & 1 deletion packages/deploy-script-support/src/writeCoreProposal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import fs from 'fs';
import { E } from '@endo/far';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';

import { assertOfferResult } from '../../src/assertOfferResult.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { makeCoreProposalBehavior } from '../../src/coreProposalBehavior.js';

test('coreProposalBehavior', async t => {
const manifestInstallRef = 'manifestInstallRef';
/** @type {[string, ...unknown[]]} */
const getManifestCall = ['getManifestForTest', 'arg1', 'arg2'];
const behavior = makeCoreProposalBehavior({
E,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test('getBundlerMaker - already made', async t => {
t.deepEqual(path, ['scratch', 'bundlerMaker']);
return 'BUNDLER_MAKER_FOUND';
};
// @ts-expect-error omitting args for test
const getBundlerMaker = makeGetBundlerMaker({}, { lookup });

const bundler = await getBundlerMaker({ log: t.log });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeZoeKit } from '@agoric/zoe';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeZoeKit } from '@agoric/zoe';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { makeZoeKit } from '@agoric/zoe';
Expand Down
1 change: 1 addition & 0 deletions packages/governance/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"checkJs": true,
"noEmit": true,
"downlevelIteration": true,
"strictNullChecks": true,
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/binaryVoteCounter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { Far } from '@endo/marshal';
import { makePromiseKit } from '@endo/promise-kit';
import { makeHeapFarInstance, keyEQ, makeStore } from '@agoric/store';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/closingRule.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

// Standard closing rule is a deadline and Timer. An alternative might allow for
// emergency votes that can close as soon as a quorum or other threshold is
// reached.
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/committee.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { makeStoredPublishKit } from '@agoric/notifier';
import { makeStore, makeHeapFarInstance, M } from '@agoric/store';
import { natSafeMath } from '@agoric/zoe/src/contractSupport/index.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernance/assertions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { isRemotable } from '@endo/marshal';
import { assertIsRatio } from '@agoric/zoe/src/contractSupport/ratio.js';

Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernance/governApi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { keyEQ } from '@agoric/store';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernance/governFilter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { fit, keyEQ } from '@agoric/store';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernance/governParam.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { deeplyFulfilled, Far } from '@endo/marshal';
import { fit, keyEQ } from '@agoric/store';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernance/paramManager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { Far, passStyleOf } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp';
import { assertKeywordName } from '@agoric/zoe/src/cleanProposal.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { ParamTypes } from '../constants.js';
import { CONTRACT_ELECTORATE } from './governParam.js';
import { makeParamManagerBuilder } from './paramManager.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractGovernor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { fit } from '@agoric/store';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/contractHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { Far } from '@endo/marshal';
import { makeStoredPublisherKit } from '@agoric/notifier';
import { getMethodNames, objectMap } from '@agoric/internal';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/electorateTools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { deeplyFulfilled, Far } from '@endo/marshal';

Expand Down
3 changes: 1 addition & 2 deletions packages/governance/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check

import './types.js';
import '@agoric/vats/src/core/types.js';

export {
ChoiceMethod,
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/noActionElectorate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { makePublishKit } from '@agoric/notifier';
import { makePromiseKit } from '@endo/promise-kit';
import { makeHeapFarInstance } from '@agoric/store';
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/question.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { makeHeapFarInstance, fit, keyEQ, M } from '@agoric/store';
import { makeHandle } from '@agoric/zoe/src/makeHandle.js';

Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/typeGuards.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { M } from '@agoric/store';
import { TimestampShape } from '@agoric/swingset-vat/src/vats/timer/typeGuards.js';
import {
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

/**
* @typedef { 'unranked' | 'order' } ChoiceMethod
* * UNRANKED: "unranked voting" means that the voter specifies some number of
Expand Down
2 changes: 0 additions & 2 deletions packages/governance/src/validators.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';

const { details: X, quote: q } = assert;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import { makeBoard } from '@agoric/vats/src/lib-board.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init/debug.js';
import test from 'ava';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { makeNotifierFromSubscriber, observeNotifier } from '@agoric/notifier';
import { keyEQ } from '@agoric/store';
import { E } from '@endo/eventual-send';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { Far } from '@endo/marshal';

import { makeZoeKit } from '@agoric/zoe';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { handleParamGovernance } from '../../../src/contractHelper.js';
import { ParamTypes } from '../../../src/index.js';
import { CONTRACT_ELECTORATE } from '../../../src/contractGovernance/governParam.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import '@endo/init/debug.js';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { E } from '@endo/eventual-send';
import { Far } from '@endo/marshal';

Expand Down
Loading

0 comments on commit 6728cd4

Please sign in to comment.