Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

chore: update to latest ERTP #30

Merged
merged 3 commits into from
Nov 6, 2021
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
2 changes: 1 addition & 1 deletion contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ava": "^3.11.1",
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-jessie": "0.0.3",
"eslint-config-jessie": "^0.0.6",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsdoc": "^32.3.0",
Expand Down
15 changes: 8 additions & 7 deletions contract/test/test-coveredCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import bundleSource from '@agoric/bundle-source';
import { E } from '@agoric/eventual-send';
import { makeFakeVatAdmin } from '@agoric/zoe/tools/fakeVatAdmin';
import { makeZoeKit } from '@agoric/zoe';
import { makeIssuerKit, AssetKind, amountMath } from '@agoric/ertp';
import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
import buildManualTimer from '@agoric/zoe/tools/manualTimer';

test('contract with valid offers', async t => {
Expand Down Expand Up @@ -42,10 +42,11 @@ test('contract with valid offers', async t => {
const moolaKit = makeIssuerKit('moola');
// value is i.e. 20, or 44

const magicWandAmount = amountMath.make(magicItemKit.brand, [
'magicWand8281',
]);
const moola20 = amountMath.make(moolaKit.brand, 20n);
const magicWandAmount = AmountMath.make(
magicItemKit.brand,
harden(['magicWand8281']),
);
const moola20 = AmountMath.make(moolaKit.brand, 20n);
const aliceMagicWandPayment = magicItemKit.mint.mintPayment(magicWandAmount);
const bobMoolaPayment = moolaKit.mint.mintPayment(moola20);

Expand Down Expand Up @@ -141,7 +142,7 @@ test('contract with valid offers', async t => {

t.deepEqual(
await moolaKit.issuer.getAmountOf(bobMoolaPayout),
amountMath.makeEmpty(moolaKit.brand, AssetKind.NAT),
AmountMath.makeEmpty(moolaKit.brand, AssetKind.NAT),
);

// Alice gets what she wanted
Expand All @@ -151,7 +152,7 @@ test('contract with valid offers', async t => {

t.deepEqual(
await magicItemKit.issuer.getAmountOf(aliceMagicItemPayout),
amountMath.makeEmpty(magicItemKit.brand, AssetKind.SET),
AmountMath.makeEmpty(magicItemKit.brand, AssetKind.SET),
);

t.deepEqual(await moolaKit.issuer.getAmountOf(aliceMoolaPayout), moola20);
Expand Down
27 changes: 14 additions & 13 deletions contract/test/test-otcDesk.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/* global require __dirname */

import '@agoric/zoe/tools/prepare-test-env';
Expand All @@ -8,7 +9,7 @@ import bundleSource from '@agoric/bundle-source';
import { E } from '@agoric/eventual-send';
import { makeFakeVatAdmin } from '@agoric/zoe/tools/fakeVatAdmin';
import { makeZoeKit } from '@agoric/zoe';
import { makeIssuerKit, AssetKind, amountMath } from '@agoric/ertp';
import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
import buildManualTimer from '@agoric/zoe/tools/manualTimer';

const otcDeskPath = `${__dirname}/../src/otcDesk`;
Expand Down Expand Up @@ -42,19 +43,19 @@ test('contract with valid offers', async t => {
const moolaKit = makeIssuerKit('moola');
// value is i.e. 20, or 44

const magicWandAmount = amountMath.make(magicItemKit.brand, [
'magicWand8281',
]);
const magicWandAmount = AmountMath.make(
magicItemKit.brand,
harden(['magicWand8281']),
);

const magicItemsAmount = amountMath.make(magicItemKit.brand, [
'magicWand8281',
'sword1',
'sword2',
]);
const magicItemsAmount = AmountMath.make(
magicItemKit.brand,
harden(['magicWand8281', 'sword1', 'sword2']),
);

const moola1000 = amountMath.make(moolaKit.brand, 1000n);
const moola1000 = AmountMath.make(moolaKit.brand, 1000n);

const moola20 = amountMath.make(moolaKit.brand, 20n);
const moola20 = AmountMath.make(moolaKit.brand, 20n);

const bobMoolaPayment = moolaKit.mint.mintPayment(moola20);

Expand Down Expand Up @@ -167,14 +168,14 @@ test('contract with valid offers', async t => {

t.deepEqual(
await moolaKit.issuer.getAmountOf(bobMoolaPayout),
amountMath.makeEmpty(moolaKit.brand, AssetKind.NAT),
AmountMath.makeEmpty(moolaKit.brand, AssetKind.NAT),
);

const removeInventoryInvitation = await E(
creatorFacet,
).makeRemoveInventoryInvitation();

const moola2 = amountMath.make(moolaKit.brand, 2n);
const moola2 = AmountMath.make(moolaKit.brand, 2n);

const removeInventoryProposal = harden({
want: { Moola: moola2 },
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.18.0",
"eslint-plugin-react-hooks": "^2.3.0",
"prettier": "^1.18.2"
"prettier": "^1.18.2",
"@jessie.js/eslint-plugin": "^0.1.3",
"@endo/eslint-plugin": "^0.3.12"
},
"globals": {
"harden": "readonly"
Expand Down
29 changes: 18 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,13 @@
dependencies:
arrify "^1.0.1"

"@endo/eslint-plugin@^0.3.12":
version "0.3.12"
resolved "https://registry.yarnpkg.com/@endo/eslint-plugin/-/eslint-plugin-0.3.12.tgz#7708a3d44be033e9ce4e9bd6a563dc97250cffec"
integrity sha512-0DbILeOj2Mhl7TwtHkQCGLP40njqlbKflXrSiYcfveRi8eFs/ZFHr+TvnaC7Mg6evbxDG2wcLmQBNLvgKGxnYg==
dependencies:
requireindex "~1.1.0"

"@eslint/eslintrc@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547"
Expand All @@ -666,6 +673,13 @@
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c"
integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==

"@jessie.js/eslint-plugin@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@jessie.js/eslint-plugin/-/eslint-plugin-0.1.3.tgz#4df87d639dbc8ffb4c0b0168de1311b7f522cc75"
integrity sha512-wyx/Wz/5gx87GRijQ3U6XGBYh9AnJdkw5pNgz0xZrLv6a6+l/t1p/7AeqYeolu5nDPuic/jSxfybkcWgYaP7UA==
dependencies:
requireindex "~1.1.0"

"@nodelib/[email protected]":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
Expand Down Expand Up @@ -1972,13 +1986,6 @@ eslint-config-airbnb@^18.0.1:
object.assign "^4.1.0"
object.entries "^1.1.2"

[email protected]:
version "0.0.3"
resolved "https://registry.yarnpkg.com/eslint-config-jessie/-/eslint-config-jessie-0.0.3.tgz#6f4fae06d5c921887b89f5c7a6acbec866c79a27"
integrity sha512-L1JpgIZ+mXfKjTnVSykEknxvPHo14JHlkjfxmHBfCiOtF4CWq0H4EB1fUoxldjP1x87xZu0c0+WPqyqbvnFVxA==
dependencies:
requireindex "^1.2.0"

eslint-config-jessie@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/eslint-config-jessie/-/eslint-config-jessie-0.0.6.tgz#429de65983cdfcb161c62a5169605ded6130487b"
Expand Down Expand Up @@ -4254,10 +4261,10 @@ require-main-filename@^2.0.0:
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==

requireindex@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef"
integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==
requireindex@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162"
Comment on lines +4264 to +4266
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this change to an earlier version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@endo/eslint-plugin@^0.3.12" requires it

integrity sha1-5UBLgVV+91225JxacgBIk/4D4WI=

resolve-cwd@^3.0.0:
version "3.0.0"
Expand Down