diff --git a/contract/package.json b/contract/package.json index 44373463..19210877 100644 --- a/contract/package.json +++ b/contract/package.json @@ -56,6 +56,7 @@ "@agoric/vats": "0.15.2-u14.0", "@agoric/zoe": "^0.26.3-u14.0", "@endo/bundle-source": "^2.8.0", + "@endo/exo": "^0.2.2", "@endo/far": "^0.2.22", "@endo/init": "^0.5.60", "@endo/marshal": "^0.8.9", diff --git a/contract/src/fixHub.js b/contract/src/fixHub.js index 1583c837..168a4a4c 100644 --- a/contract/src/fixHub.js +++ b/contract/src/fixHub.js @@ -1,5 +1,7 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; const { Fail } = assert; @@ -11,20 +13,28 @@ const { Fail } = assert; export const fixHub = async namesByAddressAdmin => { assert(namesByAddressAdmin, 'no namesByAddressAdmin???'); /** @type {import('@agoric/vats').NameHub} */ - const hub = Far('Hub work-around', { - lookup: async (addr, ...rest) => { - await E(namesByAddressAdmin).reserve(addr); - const addressAdmin = await E(namesByAddressAdmin).lookupAdmin(addr); - assert(addressAdmin, 'no admin???'); - const addressHub = E(addressAdmin).readonly(); - if (rest.length === 0) return addressHub; - await E(addressAdmin).reserve(rest[0]); - return E(addressHub).lookup(...rest); + const hub = makeExo( + 'Hub work-around', + M.interface( + 'Hub work-around', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { + lookup: async (addr, ...rest) => { + await E(namesByAddressAdmin).reserve(addr); + const addressAdmin = await E(namesByAddressAdmin).lookupAdmin(addr); + assert(addressAdmin, 'no admin???'); + const addressHub = E(addressAdmin).readonly(); + if (rest.length === 0) return addressHub; + await E(addressAdmin).reserve(rest[0]); + return E(addressHub).lookup(...rest); + }, + has: _key => Fail`key space not well defined`, + entries: () => Fail`enumeration not supported`, + values: () => Fail`enumeration not supported`, + keys: () => Fail`enumeration not supported`, }, - has: _key => Fail`key space not well defined`, - entries: () => Fail`enumeration not supported`, - values: () => Fail`enumeration not supported`, - keys: () => Fail`enumeration not supported`, - }); + ); return hub; }; diff --git a/contract/src/platform-goals/board-aux.core.js b/contract/src/platform-goals/board-aux.core.js index bcb1d953..06960961 100644 --- a/contract/src/platform-goals/board-aux.core.js +++ b/contract/src/platform-goals/board-aux.core.js @@ -1,5 +1,7 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; const { Fail } = assert; @@ -59,9 +61,33 @@ export const makeBoardAuxManager = (zone, marshalData, powers) => { ); return harden({ - brandAuxPublisher: Far('BrandAuxPublisher', { publishBrandInfo }), - boardAuxTOFU: Far('BoardAuxTOFU', { publishBrandInfo, init }), - boardAuxAdmin: Far('BoardAuxAdmin', { publishBrandInfo, init, update }), + brandAuxPublisher: makeExo( + 'BrandAuxPublisher', + M.interface( + 'BrandAuxPublisher', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { publishBrandInfo }, + ), + boardAuxTOFU: makeExo( + 'BoardAuxTOFU', + M.interface( + 'BoardAuxTOFU', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { publishBrandInfo, init }, + ), + boardAuxAdmin: makeExo( + 'BoardAuxAdmin', + M.interface( + 'BoardAuxAdmin', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { publishBrandInfo, init, update }, + ), }); }; /** @typedef {ReturnType} BoardAuxManager */ diff --git a/contract/src/postal-service.contract.js b/contract/src/postal-service.contract.js index 2bd08ff2..9439a517 100644 --- a/contract/src/postal-service.contract.js +++ b/contract/src/postal-service.contract.js @@ -1,6 +1,7 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; import { M, mustMatch } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js'; const { keys, values } = Object; @@ -61,12 +62,16 @@ export const start = zcf => { return zcf.makeInvitation(handleSend, 'send'); }; - const publicFacet = Far('postalSvc', { - lookup: (...path) => E(namesByAddress).lookup(...path), - getDepositFacet, - sendTo, - makeSendInvitation, - }); + const publicFacet = makeExo( + 'postalSvc', + M.interface('postalSvc', {}, { defaultGuards: 'passable', sloppy: true }), + { + lookup: (...path) => E(namesByAddress).lookup(...path), + getDepositFacet, + sendTo, + makeSendInvitation, + }, + ); return { publicFacet }; }; /** @typedef { typeof start } PostalServiceFn */ diff --git a/contract/src/sell-concert-tickets.contract.js b/contract/src/sell-concert-tickets.contract.js index 7ee86439..a8505a55 100644 --- a/contract/src/sell-concert-tickets.contract.js +++ b/contract/src/sell-concert-tickets.contract.js @@ -19,8 +19,8 @@ */ // @ts-check -import { Far } from '@endo/far'; import { M, getCopyBagEntries, makeCopyBag } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { AssetKind } from '@agoric/ertp/src/amountMath.js'; import { atomicRearrange } from '@agoric/zoe/src/contractSupport/atomicTransfer.js'; import '@agoric/zoe/exported.js'; @@ -209,9 +209,17 @@ export const start = async zcf => { zcf.makeInvitation(tradeHandler, 'buy tickets', undefined, proposalShape); // Mark the publicFacet Far, i.e. reachable from outside the contract - const publicFacet = Far('Tickets Public Facet', { - makeTradeInvitation, - }); + const publicFacet = makeExo( + 'Tickets Public Facet', + M.interface( + 'Tickets Public Facet', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { + makeTradeInvitation, + }, + ); return harden({ publicFacet }); }; harden(start); diff --git a/contract/src/swaparoo.contract.js b/contract/src/swaparoo.contract.js index cf393b2e..792e4f23 100644 --- a/contract/src/swaparoo.contract.js +++ b/contract/src/swaparoo.contract.js @@ -2,7 +2,8 @@ // @ts-check import { M, matches, mustMatch } from '@endo/patterns'; -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { makeExo } from '@endo/exo'; import '@agoric/zoe/exported.js'; import { atomicRearrange } from '@agoric/zoe/src/contractSupport/atomicTransfer.js'; import '@agoric/zoe/src/contracts/exported.js'; @@ -198,15 +199,23 @@ export const start = async (zcf, privateArgs, baggage) => { return firstInvitation; }; - const publicFacet = Far('Public', { - makeFirstInvitation, - ...publicMixin, - }); - const limitedCreatorFacet = Far('Creator', { - makeCollectFeesInvitation() { - return makeCollectFeesInvitation(zcf, feeSeat, feeBrand, 'Fee'); + const publicFacet = makeExo( + 'Public', + M.interface('Public', {}, { defaultGuards: 'passable', sloppy: true }), + { + makeFirstInvitation, + ...publicMixin, + }, + ); + const limitedCreatorFacet = makeExo( + 'Creator', + M.interface('Creator', {}, { defaultGuards: 'passable', sloppy: true }), + { + makeCollectFeesInvitation() { + return makeCollectFeesInvitation(zcf, feeSeat, feeBrand, 'Fee'); + }, }, - }); + ); const { governorFacet } = makeDurableGovernorFacet( baggage, limitedCreatorFacet, diff --git a/contract/test/boot-tools.js b/contract/test/boot-tools.js index ed8973b5..d1736214 100644 --- a/contract/test/boot-tools.js +++ b/contract/test/boot-tools.js @@ -1,5 +1,7 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { makeNameHubKit, makePromiseSpace } from '@agoric/vats'; import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js'; import { makeWellKnownSpaces } from '@agoric/vats/src/core/utils.js'; @@ -95,7 +97,17 @@ export const mockBootstrapPowers = async ( spaces.issuer.produce.BLD.resolve(bldIssuerKit.issuer); spaces.issuer.produce.IST.resolve(feeIssuer); spaces.issuer.produce.Invitation.resolve(invitationIssuer); - produce.priceAuthority.resolve(Far('NullPriceAuthority', {})); + produce.priceAuthority.resolve( + makeExo( + 'NullPriceAuthority', + M.interface( + 'NullPriceAuthority', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + {}, + ), + ); /** * @type {BootstrapPowers & import('../src/types').NonNullChainStorage} @@ -212,20 +224,25 @@ export const makeMockTools = async (t, bundleCache) => { // XXX marshal context is not fresh. hm. const makeQueryTool = () => { - return Far('QT', { - toCapData: x => boardMarshaller.toCapData(x), // XXX remote??? - fromCapData: d => boardMarshaller.fromCapData(d), - queryData: async path => { - const parts = path.split('.'); - if (parts.shift() !== 'published') throw Error(`not found: ${path}`); - if (parts.shift() !== 'agoricNames') throw Error(`not found: ${path}`); - if (parts.length !== 1) throw Error(`not found: ${path}`); - const hub = E(agoricNames).lookup(parts[0]); - const kvs = await E(hub).entries(); - boardMarshaller.toCapData(kvs); // remember object identities - return kvs; + return makeExo( + 'QT', + M.interface('QT', {}, { defaultGuards: 'passable', sloppy: true }), + { + toCapData: x => boardMarshaller.toCapData(x), // XXX remote??? + fromCapData: d => boardMarshaller.fromCapData(d), + queryData: async path => { + const parts = path.split('.'); + if (parts.shift() !== 'published') throw Error(`not found: ${path}`); + if (parts.shift() !== 'agoricNames') + throw Error(`not found: ${path}`); + if (parts.length !== 1) throw Error(`not found: ${path}`); + const hub = E(agoricNames).lookup(parts[0]); + const kvs = await E(hub).entries(); + boardMarshaller.toCapData(kvs); // remember object identities + return kvs; + }, }, - }); + ); }; return { diff --git a/contract/test/lib-gov-test/puppet-gov.js b/contract/test/lib-gov-test/puppet-gov.js index 5cd6b091..3ea1ab0b 100644 --- a/contract/test/lib-gov-test/puppet-gov.js +++ b/contract/test/lib-gov-test/puppet-gov.js @@ -1,6 +1,8 @@ // @ts-check // borrowed from https://github.com/Agoric/agoric-sdk/blob/master/packages/inter-protocol/test/supports.js -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { createRequire } from 'node:module'; const nodeRequire = createRequire(import.meta.url); @@ -54,9 +56,18 @@ export const mockElectorate = async (zoe, bundleCache) => { await bundleCache.load(assets.invitationMakerContract), ); const arbInstance = await E(zoe).startInstance(installation); - const committeeCreatorFacet = Far('Electorate CF', { - getPoserInvitation: async () => E(arbInstance.publicFacet).makeInvitation(), - }); + const committeeCreatorFacet = makeExo( + 'Electorate CF', + M.interface( + 'Electorate CF', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { + getPoserInvitation: async () => + E(arbInstance.publicFacet).makeInvitation(), + }, + ); return { creatorFacet: committeeCreatorFacet }; }; diff --git a/contract/test/test-bundle-source.js b/contract/test/test-bundle-source.js index 29e2f3f4..21323eb2 100644 --- a/contract/test/test-bundle-source.js +++ b/contract/test/test-bundle-source.js @@ -12,7 +12,9 @@ import { E, passStyleOf } from '@endo/far'; import { makeZoeKitForTest } from '@agoric/zoe/tools/setup-zoe.js'; const myRequire = createRequire(import.meta.url); -const contractPath = myRequire.resolve(`../src/sell-concert-tickets.contract.js`); +const contractPath = myRequire.resolve( + `../src/sell-concert-tickets.contract.js`, +); test('bundleSource() bundles the contract for use with zoe', async t => { const bundle = await bundleSource(contractPath); diff --git a/contract/test/wallet-tools.js b/contract/test/wallet-tools.js index 6412d7fe..a262fb5b 100644 --- a/contract/test/wallet-tools.js +++ b/contract/test/wallet-tools.js @@ -4,7 +4,9 @@ * @see {mockWalletFactory} */ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { makePromiseKit } from '@endo/promise-kit'; // eslint-disable-next-line import/no-extraneous-dependencies @@ -58,19 +60,27 @@ export const mockWalletFactory = ( const invitationPurse = purseByBrand.get(invitationBrand); assert(invitationPurse); - const depositFacet = Far('DepositFacet', { - /** @param {Payment} pmt */ - receive: async pmt => { - const pBrand = await E(pmt).getAllegedBrand(); - if (!purseByBrand.has(pBrand)) - throw Error(`brand not known/supported: ${pBrand}`); - const purse = purseByBrand.get(pBrand); - assert(purse); - const amt = await E(purse).deposit(pmt); - console.log('receive', address, amt); - return amt; + const depositFacet = makeExo( + 'DepositFacet', + M.interface( + 'DepositFacet', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { + /** @param {Payment} pmt */ + receive: async pmt => { + const pBrand = await E(pmt).getAllegedBrand(); + if (!purseByBrand.has(pBrand)) + throw Error(`brand not known/supported: ${pBrand}`); + const purse = purseByBrand.get(pBrand); + assert(purse); + const amt = await E(purse).deposit(pmt); + console.log('receive', address, amt); + return amt; + }, }, - }); + ); await E(addressAdmin).default(DEPOSIT_FACET_KEY, depositFacet); /** @param {InvitationSpec & { source: 'contract'}} invitationSpec */ @@ -177,7 +187,7 @@ export const mockWalletFactory = ( * * @param {Brand} brand */ - async function* purseUpdates(brand) { + async function* purseUpdatesInternal(brand) { const purse = purseByBrand.get(brand) || Fail`no purse for ${q(brand)}; issuer missing? ${q( @@ -189,10 +199,24 @@ export const mockWalletFactory = ( } } + const purseUpdates = brand => purseUpdatesInternal(brand); + return { deposit: depositFacet, - offers: Far('Offers', { executeOffer, tryExit }), - peek: Far('Wallet Peek', { purseUpdates }), + offers: makeExo( + 'Offers', + M.interface('Offers', {}, { defaultGuards: 'passable', sloppy: true }), + { executeOffer, tryExit }, + ), + peek: makeExo( + 'Wallet Peek', + M.interface( + 'Wallet Peek', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { purseUpdates }, + ), }; }; diff --git a/contract/tools/e2e-tools.js b/contract/tools/e2e-tools.js index 4b5e6218..eaba36aa 100644 --- a/contract/tools/e2e-tools.js +++ b/contract/tools/e2e-tools.js @@ -1,6 +1,8 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; // eslint-disable-next-line import/no-extraneous-dependencies import { Nat } from '@endo/nat'; import { flags, makeAgd } from './agd-lib.js'; @@ -228,25 +230,37 @@ export const provisionSmartWallet = async ( } /** @type {import('../test/wallet-tools.js').MockWallet['offers']} */ - const offers = Far('Offers', { - executeOffer, - /** @param {string|number} offerId */ - tryExit: offerId => sendAction({ method: 'tryExitOffer', offerId }), - }); + const offers = makeExo( + 'Offers', + M.interface('Offers', {}, { defaultGuards: 'passable', sloppy: true }), + { + executeOffer, + /** @param {string|number} offerId */ + tryExit: offerId => sendAction({ method: 'tryExitOffer', offerId }), + }, + ); /** @type {import('../test/wallet-tools.js').MockWallet['deposit']} */ - const deposit = Far('DepositFacet', { - receive: async payment => { - const brand = await E(payment).getAllegedBrand(); - const asset = vbankEntries.find(([_denom, a]) => a.brand === brand); - if (!asset) throw Error(`unknown brand`); - /** @type {Issuer} */ - const issuer = asset.issuer; - const amt = await E(issuer).getAmountOf(payment); - await sendFromWhale(asset.denom, amt.value); - return amt; + const deposit = makeExo( + 'DepositFacet', + M.interface( + 'DepositFacet', + {}, + { defaultGuards: 'passable', sloppy: true }, + ), + { + receive: async payment => { + const brand = await E(payment).getAllegedBrand(); + const asset = vbankEntries.find(([_denom, a]) => a.brand === brand); + if (!asset) throw Error(`unknown brand`); + /** @type {Issuer} */ + const issuer = asset.issuer; + const amt = await E(issuer).getAmountOf(payment); + await sendFromWhale(asset.denom, amt.value); + return amt; + }, }, - }); + ); const { stringify: lit } = JSON; /** @@ -296,7 +310,11 @@ export const provisionSmartWallet = async ( } /** @type {import('../test/wallet-tools.js').MockWallet['peek']} */ - const peek = Far('Peek', { purseUpdates }); + const peek = makeExo( + 'Peek', + M.interface('Peek', {}, { defaultGuards: 'passable', sloppy: true }), + { purseUpdates }, + ); return { offers, deposit, peek }; }; diff --git a/contract/tools/ui-kit-goals/makeHttpClient.js b/contract/tools/ui-kit-goals/makeHttpClient.js index 7033d83c..420f2e5e 100644 --- a/contract/tools/ui-kit-goals/makeHttpClient.js +++ b/contract/tools/ui-kit-goals/makeHttpClient.js @@ -1,5 +1,6 @@ // @ts-check -import { Far } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; const { freeze } = Object; @@ -92,9 +93,14 @@ export const makeAPI = (apiAddress, { fetch }) => { }); }; - return Far('LCD', { - getJSON, - latestBlock: () => getJSON(`/cosmos/base/tendermint/v1beta1/blocks/latest`), - }); + return makeExo( + 'LCD', + M.interface('LCD', {}, { defaultGuards: 'passable', sloppy: true }), + { + getJSON, + latestBlock: () => + getJSON(`/cosmos/base/tendermint/v1beta1/blocks/latest`), + }, + ); }; /** @typedef {ReturnType} LCD */ diff --git a/contract/tools/ui-kit-goals/name-service-client.js b/contract/tools/ui-kit-goals/name-service-client.js index 2ccb6647..589bfec6 100644 --- a/contract/tools/ui-kit-goals/name-service-client.js +++ b/contract/tools/ui-kit-goals/name-service-client.js @@ -1,5 +1,7 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; /** @param {{ queryData: (path: string) => any }} qt */ export const makeAgoricNames = async qt => { @@ -14,11 +16,15 @@ export const makeAgoricNames = async qt => { } const entries = await qt.queryData(`published.agoricNames.${kind}`); const record = Object.fromEntries(entries); - const hub = Far('NameHub', { - lookup: name => record[name], - keys: () => entries.map(e => e[0]), - entries: () => entries, - }); + const hub = makeExo( + 'NameHub', + M.interface('NameHub', {}, { defaultGuards: 'passable', sloppy: true }), + { + lookup: name => record[name], + keys: () => entries.map(e => e[0]), + entries: () => entries, + }, + ); nameHubCache.set(kind, hub); return hub; }; @@ -27,17 +33,24 @@ export const makeAgoricNames = async qt => { nameHubCache.clear(); }; - const hub0 = Far('Hub', { - lookup: async (kind, ...more) => { - const hub2 = lookupKind(kind); - if (more.length > 0) { - return E(hub2).lookup(...more); - } - return hub2; + const hub0 = makeExo( + 'Hub', + M.interface('Hub', {}, { defaultGuards: 'passable', sloppy: true }), + { + lookup: async (kind, ...more) => { + const hub2 = lookupKind(kind); + if (more.length > 0) { + return E(hub2).lookup(...more); + } + return hub2; + }, }, - }); + ); - return { lookup: hub0.lookup, invalidate }; + return { + lookup: (kind, ...more) => hub0.lookup(kind, ...more), + invalidate, + }; }; const pmethods = harden(['then', 'catch', 'finally']); // See also: https://github.com/endojs/endo/tree/mfig-o/packages/o diff --git a/contract/tools/ui-kit-goals/queryKit.js b/contract/tools/ui-kit-goals/queryKit.js index 7559c961..5d1dcdb9 100644 --- a/contract/tools/ui-kit-goals/queryKit.js +++ b/contract/tools/ui-kit-goals/queryKit.js @@ -1,6 +1,8 @@ // @ts-check -import { E, Far } from '@endo/far'; +import { E } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { batchVstorageQuery } from './batchQuery.js'; import { makeClientMarshaller } from './marshalTables.js'; @@ -79,24 +81,28 @@ export async function* eachVstorageUpdate(key, { vstorage, delay }) { * @param {import('./batchQuery.js').VStorage} powers.vstorage */ export const makeWalletView = (addr, { query, vstorage }) => { - return Far('WalletQuery', { - current: () => query.queryData(`published.wallet.${addr}.current`), - /** - * TODO: visit in chunks by block - * @param {ERef<{visit: (r: import('@agoric/smart-wallet/src/smartWallet.js').UpdateRecord) => void}>} visitor - * @param {number} [minHeight] - */ - history: async (visitor, minHeight) => { - const history = vstorage.readHistoryBy( - s => query.fromCapData(JSON.parse(s)), - `published.wallet.${addr}`, - minHeight, - ); - for await (const record of history) { - await E(visitor).visit(record); - } + return makeExo( + 'WalletQuery', + M.interface('WalletQuery', {}, { defaultGuards: 'passable', sloppy: true }), + { + current: () => query.queryData(`published.wallet.${addr}.current`), + /** + * TODO: visit in chunks by block + * @param {ERef<{visit: (r: import('@agoric/smart-wallet/src/smartWallet.js').UpdateRecord) => void}>} visitor + * @param {number} [minHeight] + */ + history: async (visitor, minHeight) => { + const history = vstorage.readHistoryBy( + s => query.fromCapData(JSON.parse(s)), + `published.wallet.${addr}`, + minHeight, + ); + for await (const record of history) { + await E(visitor).visit(record); + } + }, }, - }); + ); }; /** @typedef {ReturnType} WalletView } */ @@ -132,16 +138,20 @@ export const makeQueryKit = (vstorage, m = makeClientMarshaller()) => { } } - const query = Far('QueryTool', { - batchQuery, - queryData, - follow, - queryChildren, - fromCapData: m.fromCapData, - toCapData: m.toCapData, - // XXX wrong layer? add makeWalletView(query) helper function instead? - walletView: addr => makeWalletView(addr, { query, vstorage }), - }); + const query = makeExo( + 'QueryTool', + M.interface('QueryTool', {}, { defaultGuards: 'passable', sloppy: true }), + { + batchQuery, + queryData, + follow, + queryChildren, + fromCapData: m.fromCapData, + toCapData: m.toCapData, + // XXX wrong layer? add makeWalletView(query) helper function instead? + walletView: addr => makeWalletView(addr, { query, vstorage }), + }, + ); return { vstorage, query }; }; diff --git a/contract/tools/ui-kit-goals/test-nameProxy.js b/contract/tools/ui-kit-goals/test-nameProxy.js index aa6561c1..b7550a08 100644 --- a/contract/tools/ui-kit-goals/test-nameProxy.js +++ b/contract/tools/ui-kit-goals/test-nameProxy.js @@ -1,7 +1,8 @@ import '@endo/init/debug.js'; import test from 'ava'; -import { Far } from '@endo/far'; +import { M } from '@endo/patterns'; +import { makeExo } from '@endo/exo'; import { makeNameHubKit } from '@agoric/vats'; import { makeNameProxy } from './name-service-client.js'; @@ -9,7 +10,11 @@ test('makeNameProxy makes NameHub lookup convenient', async t => { const k0 = makeNameHubKit(); const kb = makeNameHubKit(); k0.nameAdmin.update('brand', kb.nameHub, kb.nameAdmin); - const atomBrand = Far('Atom Brand', {}); + const atomBrand = makeExo( + 'Atom Brand', + M.interface('Atom Brand', {}, { defaultGuards: 'passable', sloppy: true }), + {}, + ); kb.nameAdmin.update('Atom', atomBrand); const agoricNames = k0.nameHub; diff --git a/package.json b/package.json index 45236c52..b3693057 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "start:contract": "cd contract && yarn start", "print-key": "yarn docker:make print-acct", "start:ui": "cd ui && yarn dev", + "format": "yarn prettier --write .github api contract ui", "lint": "yarn workspaces run lint", "test": "yarn workspaces run test", "test:e2e": "yarn workspace agoric-basics-ui test:e2e", diff --git a/ui/src/App.css b/ui/src/App.css index b4d6ec70..c7be5681 100644 --- a/ui/src/App.css +++ b/ui/src/App.css @@ -99,11 +99,11 @@ input { } .error { - background-color: #E11D48; + background-color: #e11d48; color: #fff; } /* increment/decrement arrows always visible */ -input[type=number]::-webkit-inner-spin-button { - opacity: 1 +input[type='number']::-webkit-inner-spin-button { + opacity: 1; } diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 7f545954..3579097c 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -20,8 +20,8 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "types": ["vitest/globals"], + "types": ["vitest/globals"] }, "include": ["src", "test"], - "references": [{ "path": "./tsconfig.node.json" }], + "references": [{ "path": "./tsconfig.node.json" }] }