From 7e0920d2e1766e67bd8d1c16f87f8e5b3ebad8b2 Mon Sep 17 00:00:00 2001 From: Kate Sills Date: Tue, 26 Oct 2021 13:56:09 -0700 Subject: [PATCH 1/3] chore: update to latest ERTP --- contract/package.json | 2 +- contract/test/test-coveredCall.js | 12 ++++++------ contract/test/test-otcDesk.js | 19 ++++++++++--------- yarn.lock | 12 ------------ 4 files changed, 17 insertions(+), 28 deletions(-) diff --git a/contract/package.json b/contract/package.json index 882ea22..e84a31b 100644 --- a/contract/package.json +++ b/contract/package.json @@ -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", diff --git a/contract/test/test-coveredCall.js b/contract/test/test-coveredCall.js index d5fd253..c40f5aa 100644 --- a/contract/test/test-coveredCall.js +++ b/contract/test/test-coveredCall.js @@ -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 => { @@ -42,10 +42,10 @@ test('contract with valid offers', async t => { const moolaKit = makeIssuerKit('moola'); // value is i.e. 20, or 44 - const magicWandAmount = amountMath.make(magicItemKit.brand, [ + const magicWandAmount = AmountMath.make(magicItemKit.brand, harden([ 'magicWand8281', - ]); - const moola20 = amountMath.make(moolaKit.brand, 20n); + ])); + const moola20 = AmountMath.make(moolaKit.brand, 20n); const aliceMagicWandPayment = magicItemKit.mint.mintPayment(magicWandAmount); const bobMoolaPayment = moolaKit.mint.mintPayment(moola20); @@ -141,7 +141,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 @@ -151,7 +151,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); diff --git a/contract/test/test-otcDesk.js b/contract/test/test-otcDesk.js index 5216e9f..f1daa93 100644 --- a/contract/test/test-otcDesk.js +++ b/contract/test/test-otcDesk.js @@ -1,4 +1,5 @@ // @ts-check + /* global require __dirname */ import '@agoric/zoe/tools/prepare-test-env'; @@ -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`; @@ -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, [ + const magicWandAmount = AmountMath.make(magicItemKit.brand, harden([ 'magicWand8281', - ]); + ])); - const magicItemsAmount = amountMath.make(magicItemKit.brand, [ + 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); @@ -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 }, diff --git a/yarn.lock b/yarn.lock index 865f1a4..f01e008 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1972,13 +1972,6 @@ eslint-config-airbnb@^18.0.1: object.assign "^4.1.0" object.entries "^1.1.2" -eslint-config-jessie@0.0.3: - 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" @@ -4254,11 +4247,6 @@ 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== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" From d9a5e3ab5e884056c0ce9615c26b8acded8b2241 Mon Sep 17 00:00:00 2001 From: Kate Sills Date: Tue, 26 Oct 2021 14:03:35 -0700 Subject: [PATCH 2/3] chore: more updates and install the necessary packages for jessie linting --- contract/test/test-coveredCall.js | 7 ++++--- contract/test/test-otcDesk.js | 18 +++++++++--------- package.json | 4 +++- yarn.lock | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/contract/test/test-coveredCall.js b/contract/test/test-coveredCall.js index c40f5aa..518bd33 100644 --- a/contract/test/test-coveredCall.js +++ b/contract/test/test-coveredCall.js @@ -42,9 +42,10 @@ test('contract with valid offers', async t => { const moolaKit = makeIssuerKit('moola'); // value is i.e. 20, or 44 - const magicWandAmount = AmountMath.make(magicItemKit.brand, harden([ - 'magicWand8281', - ])); + 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); diff --git a/contract/test/test-otcDesk.js b/contract/test/test-otcDesk.js index f1daa93..5c80048 100644 --- a/contract/test/test-otcDesk.js +++ b/contract/test/test-otcDesk.js @@ -43,15 +43,15 @@ test('contract with valid offers', async t => { const moolaKit = makeIssuerKit('moola'); // value is i.e. 20, or 44 - const magicWandAmount = AmountMath.make(magicItemKit.brand, harden([ - 'magicWand8281', - ])); - - const magicItemsAmount = AmountMath.make(magicItemKit.brand, harden([ - 'magicWand8281', - 'sword1', - 'sword2', - ])); + const magicWandAmount = AmountMath.make( + magicItemKit.brand, + harden(['magicWand8281']), + ); + + const magicItemsAmount = AmountMath.make( + magicItemKit.brand, + harden(['magicWand8281', 'sword1', 'sword2']), + ); const moola1000 = AmountMath.make(moolaKit.brand, 1000n); diff --git a/package.json b/package.json index 2dc41da..7a333c1 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/yarn.lock b/yarn.lock index f01e008..e93f063 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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/fs.scandir@2.1.3": version "2.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" @@ -4247,6 +4261,11 @@ 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.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162" + integrity sha1-5UBLgVV+91225JxacgBIk/4D4WI= + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" From 4212249a75361250793cf05a06c03d269e8af841 Mon Sep 17 00:00:00 2001 From: Kate Sills Date: Fri, 5 Nov 2021 21:11:56 -0700 Subject: [PATCH 3/3] chore: bump