Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endo integration #7273

Merged
merged 6 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"dependencies": {
"@agoric/assert": "^0.5.1",
"@endo/nat": "^4.1.0",
"@endo/nat": "^4.1.26",
"@agoric/notifier": "^0.5.1",
"@agoric/store": "^0.8.3",
"@agoric/swingset-vat": "^0.30.2",
"@agoric/vat-data": "^0.4.3",
"@endo/eventual-send": "^0.16.8",
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1",
"@endo/promise-kit": "^0.2.52"
"@endo/eventual-send": "^0.17.1",
"@endo/far": "^0.2.17",
"@endo/marshal": "^0.8.4",
"@endo/promise-kit": "^0.2.55"
},
"devDependencies": {
"@endo/bundle-source": "^2.4.2",
"@endo/bundle-source": "^2.5.0",
"@fast-check/ava": "^1.1.3",
"ava": "^5.2.0",
"tsd": "^0.25.0"
Expand Down
28 changes: 14 additions & 14 deletions packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@
"@agoric/vat-data": "^0.4.3",
"@agoric/xsnap": "^0.13.2",
"@agoric/xsnap-lockdown": "^0.13.2",
"@endo/base64": "^0.2.28",
"@endo/bundle-source": "^2.4.2",
"@endo/captp": "^2.0.18",
"@endo/check-bundle": "^0.2.14",
"@endo/compartment-mapper": "^0.8.0",
"@endo/eventual-send": "^0.16.8",
"@endo/far": "^0.2.14",
"@endo/import-bundle": "^0.3.0",
"@endo/init": "^0.5.52",
"@endo/marshal": "^0.8.1",
"@endo/nat": "^4.1.23",
"@endo/promise-kit": "^0.2.52",
"@endo/zip": "^0.2.28",
"@endo/base64": "^0.2.31",
"@endo/bundle-source": "^2.5.0",
"@endo/captp": "^3.1.0",
"@endo/check-bundle": "^0.2.17",
"@endo/compartment-mapper": "^0.8.3",
"@endo/eventual-send": "^0.17.1",
"@endo/far": "^0.2.17",
"@endo/import-bundle": "^0.3.3",
"@endo/init": "^0.5.55",
"@endo/marshal": "^0.8.4",
"@endo/nat": "^4.1.26",
"@endo/promise-kit": "^0.2.55",
"@endo/zip": "^0.2.31",
"ansi-styles": "^6.2.1",
"anylogger": "^0.21.0",
"import-meta-resolve": "^2.2.1",
"microtime": "^3.1.0",
"semver": "^6.3.0"
},
"peerDependencies": {
"@endo/ses-ava": "^0.2.36",
"@endo/ses-ava": "^0.2.39",
"ava": "^5.2.0"
},
"files": [
Expand Down
8 changes: 4 additions & 4 deletions packages/SwingSet/test/snapshots/test-xsnap-store.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Generated by [AVA](https://avajs.dev).

{
compressSeconds: 0,
hash: '2c1230d8ffb1a8cfacf6349ac22a3a5e409e8e11210b8387145afffcc39540dd',
hash: '6f23b0e7768805154bf167e8e2ee2a8dd30a8da1c6e86df0e69e03ce717cc08c',
rawSaveSeconds: 0,
uncompressedSize: 789299,
uncompressedSize: 801347,
}

> after use of harden() - sensitive to SES-shim, XS, and supervisor

{
compressSeconds: 0,
hash: 'ec4142660fa8e46062fbe2675303f96048f2362572bc122c9db42f323f223932',
hash: 'ef7fdff7967170c2fdf9c71d82a730ad1f6a8af711ee81494ed4a692d25ffda6',
rawSaveSeconds: 0,
uncompressedSize: 789555,
uncompressedSize: 801603,
}
Binary file modified packages/SwingSet/test/snapshots/test-xsnap-store.js.snap
Binary file not shown.
16 changes: 8 additions & 8 deletions packages/agoric-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
"@cosmjs/proto-signing": "^0.29.5",
"@cosmjs/stargate": "^0.29.5",
"@cosmjs/tendermint-rpc": "^0.29.5",
"@endo/bundle-source": "^2.4.2",
"@endo/captp": "^2.0.18",
"@endo/compartment-mapper": "^0.8.0",
"@endo/far": "^0.2.14",
"@endo/init": "^0.5.52",
"@endo/marshal": "^0.8.1",
"@endo/nat": "^4.1.0",
"@endo/promise-kit": "^0.2.52",
"@endo/bundle-source": "^2.5.0",
"@endo/captp": "^3.1.0",
"@endo/compartment-mapper": "^0.8.3",
"@endo/far": "^0.2.17",
"@endo/init": "^0.5.55",
"@endo/marshal": "^0.8.4",
"@endo/nat": "^4.1.26",
"@endo/promise-kit": "^0.2.55",
"@iarna/toml": "^2.2.3",
"anylogger": "^0.21.0",
"chalk": "^5.2.0",
Expand Down
1 change: 0 additions & 1 deletion packages/agoric-cli/src/follow.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default async function followerMain(progname, rawArgs, powers, opts) {
const pretty = !output.endsWith('lines');
formatOutput = ({ body, slots }) => {
const encoded = JSON.parse(body);
// @ts-expect-error Expected 1-2 arguments, but got 3.
return decodeToJustin(encoded, pretty, slots);
};
break;
Expand Down
2 changes: 1 addition & 1 deletion packages/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint:types": "tsc -p jsconfig.json"
},
"devDependencies": {
"@endo/init": "^0.5.52",
"@endo/init": "^0.5.55",
"ava": "^5.2.0"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@agoric/notifier": "^0.5.1",
"@agoric/store": "^0.8.3",
"@agoric/vat-data": "^0.4.3",
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1"
"@endo/far": "^0.2.17",
"@endo/marshal": "^0.8.4"
},
"devDependencies": {
"@agoric/zoe": "^0.25.3",
Expand Down
12 changes: 6 additions & 6 deletions packages/casting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
"@cosmjs/proto-signing": "^0.29.5",
"@cosmjs/stargate": "^0.29.5",
"@cosmjs/tendermint-rpc": "^0.29.5",
"@endo/far": "^0.2.14",
"@endo/init": "^0.5.52",
"@endo/lockdown": "^0.1.24",
"@endo/marshal": "^0.8.1",
"@endo/promise-kit": "^0.2.52",
"@endo/far": "^0.2.17",
"@endo/init": "^0.5.55",
"@endo/lockdown": "^0.1.27",
"@endo/marshal": "^0.8.4",
"@endo/promise-kit": "^0.2.55",
"node-fetch": "^2.6.0"
},
"devDependencies": {
"@endo/ses-ava": "^0.2.36",
"@endo/ses-ava": "^0.2.39",
"@types/node-fetch": "^2.6.2",
"ava": "^5.2.0",
"c8": "^7.13.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/cosmic-swingset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"@agoric/cosmos": "^0.32.2",
"@agoric/deploy-script-support": "^0.9.4",
"@agoric/internal": "^0.2.1",
"@endo/nat": "^4.1.0",
"@endo/nat": "^4.1.26",
"@agoric/store": "^0.8.3",
"@agoric/swing-store": "^0.8.1",
"@agoric/swingset-vat": "^0.30.2",
"@agoric/telemetry": "^0.4.0",
"@endo/far": "^0.2.14",
"@endo/import-bundle": "^0.3.0",
"@endo/init": "^0.5.52",
"@endo/marshal": "^0.8.1",
"@endo/far": "^0.2.17",
"@endo/import-bundle": "^0.3.3",
"@endo/init": "^0.5.55",
"@endo/marshal": "^0.8.4",
"@iarna/toml": "^2.2.3",
"@opentelemetry/sdk-metrics": "^0.32.0",
"anylogger": "^0.21.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/deploy-script-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@
"@agoric/ertp": "^0.15.3",
"@agoric/import-manager": "^0.3.6",
"@agoric/internal": "^0.2.1",
"@endo/nat": "^4.1.0",
"@endo/nat": "^4.1.26",
"@agoric/notifier": "^0.5.1",
"@agoric/store": "^0.8.3",
"@agoric/zoe": "^0.25.3",
"@endo/base64": "^0.2.28",
"@endo/bundle-source": "^2.4.2",
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1",
"@endo/promise-kit": "^0.2.52",
"@endo/zip": "^0.2.28"
"@endo/base64": "^0.2.31",
"@endo/bundle-source": "^2.5.0",
"@endo/far": "^0.2.17",
"@endo/marshal": "^0.8.4",
"@endo/promise-kit": "^0.2.55",
"@endo/zip": "^0.2.31"
},
"devDependencies": {
"@agoric/vats": "^0.13.0",
"@endo/init": "^0.5.52",
"@endo/init": "^0.5.55",
"ava": "^5.2.0",
"import-meta-resolve": "^2.2.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/deployment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"license": "Apache-2.0",
"dependencies": {
"@agoric/assert": "^0.5.1",
"@endo/init": "^0.5.52",
"@endo/marshal": "^0.8.1",
"@endo/init": "^0.5.55",
"@endo/marshal": "^0.8.4",
"chalk": "^5.2.0",
"deterministic-json": "^1.0.5",
"inquirer": "^8.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"eslint-config.json"
],
"peerDependencies": {
"@endo/eslint-plugin": "^0.4.3",
"@endo/eslint-plugin": "^0.4.4",
"@jessie.js/eslint-plugin": "^0.3.0",
"@typescript-eslint/parser": "^5.55.0",
"eslint": "^8.36.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@
"@agoric/assert": "^0.5.1",
"@agoric/ertp": "^0.15.3",
"@agoric/internal": "^0.2.1",
"@endo/nat": "^4.1.0",
"@endo/nat": "^4.1.26",
"@agoric/notifier": "^0.5.1",
"@agoric/store": "^0.8.3",
"@agoric/swingset-vat": "^0.30.2",
"@agoric/time": "^0.2.1",
"@agoric/vat-data": "^0.4.3",
"@agoric/vats": "^0.13.0",
"@agoric/zoe": "^0.25.3",
"@endo/captp": "^2.0.18",
"@endo/eventual-send": "^0.16.8",
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1",
"@endo/promise-kit": "^0.2.52"
"@endo/captp": "^3.1.0",
"@endo/eventual-send": "^0.17.1",
"@endo/far": "^0.2.17",
"@endo/marshal": "^0.8.4",
"@endo/promise-kit": "^0.2.55"
},
"devDependencies": {
"@agoric/deploy-script-support": "^0.9.4",
"@endo/bundle-source": "^2.4.2",
"@endo/init": "^0.5.52",
"@endo/bundle-source": "^2.5.0",
"@endo/init": "^0.5.55",
"ava": "^5.2.0",
"c8": "^7.13.0",
"import-meta-resolve": "^2.2.1"
Expand Down
16 changes: 8 additions & 8 deletions packages/inter-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@
"@agoric/vat-data": "^0.4.3",
"@agoric/vats": "^0.13.0",
"@agoric/zoe": "^0.25.3",
"@endo/captp": "^2.0.18",
"@endo/eventual-send": "^0.16.8",
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1",
"@endo/nat": "^4.1.23",
"@endo/captp": "^3.1.0",
"@endo/eventual-send": "^0.17.1",
"@endo/far": "^0.2.17",
"@endo/marshal": "^0.8.4",
"@endo/nat": "^4.1.26",
"agoric": "^0.18.2"
},
"devDependencies": {
"@agoric/deploy-script-support": "^0.9.4",
"@agoric/smart-wallet": "^0.4.2",
"@agoric/swingset-liveslots": "^0.9.0",
"@agoric/swingset-vat": "^0.30.2",
"@endo/bundle-source": "^2.4.2",
"@endo/init": "^0.5.52",
"@endo/promise-kit": "^0.2.52",
"@endo/bundle-source": "^2.5.0",
"@endo/init": "^0.5.55",
"@endo/promise-kit": "^0.2.55",
"@fast-check/ava": "^1.1.3",
"ava": "^5.2.0",
"c8": "^7.13.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ test('agoricName invitation source errors', async t => {
proposal: {},
}),
{
message: 'target has no method "makeGiveMintedInvitation ", has []',
message: /target has no method "makeGiveMintedInvitation ", has \[.*\]/,
},
);
t.is(await E.get(getBalanceFor(anchor.brand)).value, 0n);
Expand Down
17 changes: 11 additions & 6 deletions packages/inter-protocol/test/test-interest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const BASIS_POINTS = 10000n;
const HUNDRED_THOUSAND = 100000n;
const TEN_MILLION = 10000000n;

/** @type {Brand<'nat'>} */
const mockBrand = Far('brand');

test('too soon', async t => {
const { brand } = makeIssuerKit('ducats');
const calculator = makeInterestCalculator(
Expand Down Expand Up @@ -420,17 +423,19 @@ test('basic charge reasonable numbers monthly', async t => {
});

test('calculateCompoundedInterest on zero debt', t => {
const brand = Far('brand');
t.throws(() =>
calculateCompoundedInterest(makeRatio(0n, brand, 1n, brand), 0n, 100n),
calculateCompoundedInterest(
makeRatio(0n, mockBrand, 1n, mockBrand),
0n,
100n,
),
);
});

// -illions
const M = 1_000_000n;

test('calculateCompoundedInterest', t => {
const brand = Far('brand');
/** @type {Array<[bigint, bigint, bigint, number, bigint, number]>} */
const cases = [
[250n, BASIS_POINTS, M, 1, 1025000n, 10], // 2.5% APR over 1 year yields 2.5%
Expand All @@ -447,16 +452,16 @@ test('calculateCompoundedInterest', t => {
expected,
floatMatch,
] of cases) {
const apr = makeRatio(rateNum, brand, rateDen, brand);
const apr = makeRatio(rateNum, mockBrand, rateDen, mockBrand);
const aprf = Number(rateNum) / Number(rateDen);

let compoundedInterest = makeRatio(1n, brand, 1n, brand);
let compoundedInterest = makeRatio(1n, mockBrand, 1n, mockBrand);
let compoundedFloat = 1.0;
let totalDebt = startingDebt;

for (let i = 0; i < charges; i += 1) {
compoundedFloat *= 1 + aprf;
const delta = ceilMultiplyBy(AmountMath.make(brand, totalDebt), apr);
const delta = ceilMultiplyBy(AmountMath.make(mockBrand, totalDebt), apr);
compoundedInterest = calculateCompoundedInterest(
compoundedInterest,
totalDebt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AmountMath } from '@agoric/ertp';
import { Far } from '@endo/marshal';
import * as StoreUtils from '../../src/vaultFactory/storeUtils.js';

/** @type {Brand<'nat'>} */
export const mockBrand = Far('brand');
const keysMatch = test.macro({
exec(t, [debt, collat, vaultId], [expectedKey, numberOut]) {
Expand Down
8 changes: 4 additions & 4 deletions packages/internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
},
"dependencies": {
"@agoric/zone": "^0.1.0",
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1",
"@endo/promise-kit": "^0.2.52",
"@endo/far": "^0.2.17",
"@endo/marshal": "^0.8.4",
"@endo/promise-kit": "^0.2.55",
"anylogger": "^0.21.0",
"jessie.js": "^0.3.2"
},
"devDependencies": {
"@endo/init": "^0.5.52",
"@endo/init": "^0.5.55",
"ava": "^5.2.0"
},
"author": "Agoric",
Expand Down
Loading