From 130353d993859444fba350e9f96af8cc89a797e1 Mon Sep 17 00:00:00 2001 From: samsiegart Date: Tue, 14 Feb 2023 01:14:10 -0800 Subject: [PATCH 1/4] feat: use new invitation spec --- src/service/vaults.ts | 49 +++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/service/vaults.ts b/src/service/vaults.ts index 232e977c..39d761d8 100644 --- a/src/service/vaults.ts +++ b/src/service/vaults.ts @@ -343,13 +343,19 @@ export const makeOpenVaultOffer = async ( toLock: Amount<'nat'>, toBorrow: Amount<'nat'>, ) => { - const INVITATION_METHOD = 'makeVaultInvitation'; - - const { vaultFactoryInstanceHandle } = useVaultStore.getState(); const { importContext, offerSigner } = appStore.getState(); - const serializedInstance = importContext.fromBoard.serialize( - vaultFactoryInstanceHandle, - ) as CapData<'Instance'>; + + const invitationSpec = importContext.fromBoard.serialize( + harden({ + source: 'agoricContract', + instancePath: ['VaultFactory'], + callPipe: [ + ['getCollateralManager', [toLock.brand]], + ['makeVaultInvitation'], + ], + }), + ); + const serializedToLock = importContext.fromBoard.serialize( toLock, ) as CapData<'Amount'>; @@ -358,8 +364,7 @@ export const makeOpenVaultOffer = async ( ) as CapData<'Amount'>; const offerConfig = { - publicInvitationMaker: INVITATION_METHOD, - instanceHandle: serializedInstance, + invitationSpec, proposalTemplate: harden({ give: { Collateral: { @@ -407,14 +412,16 @@ export const makeAdjustVaultOffer = async ({ collateral, debt, }: AdjustParams) => { - const invitationSpec = { - source: 'continuing', - previousOffer: vaultOfferId, - invitationMakerName: 'AdjustBalances', - }; - const { importContext, offerSigner } = appStore.getState(); + const invitationSpec = importContext.fromBoard.serialize( + harden({ + source: 'continuing', + previousOffer: vaultOfferId, + invitationMakerName: 'AdjustBalances', + }), + ); + const proposal: Proposal = { give: {}, want: {} }; if (collateral?.action === CollateralAction.Deposit) { @@ -459,14 +466,16 @@ export const makeCloseVaultOffer = async ( collateral?: Amount<'nat'>, debt?: Amount<'nat'>, ) => { - const invitationSpec = { - source: 'continuing', - previousOffer: vaultOfferId, - invitationMakerName: 'CloseVault', - }; - const { importContext, offerSigner } = appStore.getState(); + const invitationSpec = importContext.fromBoard.serialize( + harden({ + source: 'continuing', + previousOffer: vaultOfferId, + invitationMakerName: 'CloseVault', + }), + ); + const collateralToWant = collateral ? { amount: importContext.fromBoard.serialize(collateral), From cd433e2c8926006e2cd12097a5724cb940b053a8 Mon Sep 17 00:00:00 2001 From: samsiegart Date: Tue, 14 Feb 2023 01:20:18 -0800 Subject: [PATCH 2/4] chore: remove unused instance handle --- src/service/vaults.ts | 22 ---------------------- src/store/vaults.ts | 4 ---- src/views/Vaults.tsx | 8 +------- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/service/vaults.ts b/src/service/vaults.ts index 39d761d8..e32eafcd 100644 --- a/src/service/vaults.ts +++ b/src/service/vaults.ts @@ -261,21 +261,6 @@ export const watchVaultFactory = (netconfigUrl: string) => { } }; - const watchVaultFactoryInstanceHandle = async () => { - const path = ':published.agoricNames.instance'; - const f = makeBoardFollower(path); - for await (const { value } of iterateLatest(f)) { - if (isStopped) break; - console.debug('got update', path, value); - const instanceEntry = value.find( - ([instanceName]) => instanceName === 'VaultFactory', - ); - assert(instanceEntry, 'Missing VaultFactory from agoricNames.instances'); - useVaultStore.setState({ vaultFactoryInstanceHandle: instanceEntry[1] }); - return; - } - }; - const startWatching = async () => { let rpc: string; try { @@ -319,13 +304,6 @@ export const watchVaultFactory = (netconfigUrl: string) => { 'Error loading vault factorys governed parameters', }); }); - watchVaultFactoryInstanceHandle().catch(e => { - console.error('Error watching agoric instances', e); - useVaultStore.setState({ - vaultFactoryInstanceHandleLoadingError: - 'Error loading vault factory instance id', - }); - }); }; startWatching(); diff --git a/src/store/vaults.ts b/src/store/vaults.ts index a5deb129..affa300a 100644 --- a/src/store/vaults.ts +++ b/src/store/vaults.ts @@ -85,7 +85,6 @@ export type PriceQuote = unknown; interface VaultState { managerIdsLoadingError: string | null; vaultFactoryParamsLoadingError: string | null; - vaultFactoryInstanceHandleLoadingError: string | null; vaultManagerLoadingErrors: Map; vaultManagerIds: string[] | null; vaultManagers: Map; @@ -96,7 +95,6 @@ interface VaultState { prices: Map; priceErrors: Map; vaultFactoryParams: VaultFactoryParams | null; - vaultFactoryInstanceHandle: unknown; setPrice: (brand: Brand, priceQuote: PriceQuote) => void; setPriceError: (brand: Brand, e: unknown) => void; setVaultManagerLoadingError: (id: string, error: unknown) => void; @@ -116,12 +114,10 @@ interface VaultState { export const vaultStore = createStore()(set => ({ managerIdsLoadingError: null, vaultFactoryParamsLoadingError: null, - vaultFactoryInstanceHandleLoadingError: null, vaultManagerLoadingErrors: new Map(), vaultManagerIds: null, vaultManagers: new Map(), vaultFactoryParams: null, - vaultFactoryInstanceHandle: null, vaultGovernedParams: new Map(), vaultMetrics: new Map(), prices: new Map(), diff --git a/src/views/Vaults.tsx b/src/views/Vaults.tsx index 23048993..f451834b 100644 --- a/src/views/Vaults.tsx +++ b/src/views/Vaults.tsx @@ -70,8 +70,7 @@ const Vaults = () => { }; }, [leader, netConfig]); - const { managerIdsLoadingError, vaultFactoryInstanceHandleLoadingError } = - useVaultStore(); + const { managerIdsLoadingError } = useVaultStore(); const { watchVbankError } = useAtomValue(appAtom); const mode = useAtomValue(viewModeAtom); const adjustVaultKey = useAtomValue(vaultKeyToAdjustAtom); @@ -91,11 +90,6 @@ const Vaults = () => {
- {vaultFactoryInstanceHandleLoadingError && ( - - {vaultFactoryInstanceHandleLoadingError} - - )} {managerIdsLoadingError && ( {managerIdsLoadingError} )} From e75fd4e1c0c3975acd94c397f768199b3acef77f Mon Sep 17 00:00:00 2001 From: samsiegart Date: Tue, 14 Feb 2023 17:04:26 -0800 Subject: [PATCH 3/4] feat: annotate spec types --- package.json | 2 +- ...ic+smart-wallet+0.4.3-dev-8cbf697.0.patch} | 10 +- src/service/vaults.ts | 58 ++-- yarn.lock | 300 +++++++++++++++++- 4 files changed, 335 insertions(+), 35 deletions(-) rename patches/{@agoric+smart-wallet+0.4.3-dev-1adb7a2.0.patch => @agoric+smart-wallet+0.4.3-dev-8cbf697.0.patch} (58%) diff --git a/package.json b/package.json index 95fdfa65..c28bd4fc 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@agoric/casting": "^0.3.3-dev-1adb7a2.0", "@agoric/ertp": "^0.15.4-dev-1adb7a2.0", "@agoric/inter-protocol": "^0.13.2-dev-95a7fa5.0", - "@agoric/smart-wallet": "^0.4.3-dev-1adb7a2.0", + "@agoric/smart-wallet": "^0.4.3-dev-8cbf697.0", "@agoric/ui-components": "^0.3.4-dev-1adb7a2.0", "@agoric/wallet": "^0.17.1-dev-1adb7a2.0", "@agoric/web-components": "^0.5.1-dev-1adb7a2.0", diff --git a/patches/@agoric+smart-wallet+0.4.3-dev-1adb7a2.0.patch b/patches/@agoric+smart-wallet+0.4.3-dev-8cbf697.0.patch similarity index 58% rename from patches/@agoric+smart-wallet+0.4.3-dev-1adb7a2.0.patch rename to patches/@agoric+smart-wallet+0.4.3-dev-8cbf697.0.patch index 34ac9481..84a40161 100644 --- a/patches/@agoric+smart-wallet+0.4.3-dev-1adb7a2.0.patch +++ b/patches/@agoric+smart-wallet+0.4.3-dev-8cbf697.0.patch @@ -1,14 +1,14 @@ diff --git a/node_modules/@agoric/smart-wallet/src/marshal-contexts.js b/node_modules/@agoric/smart-wallet/src/marshal-contexts.js -index 4fcc880..aa12e55 100644 +index 20aed2b..6194e06 100644 --- a/node_modules/@agoric/smart-wallet/src/marshal-contexts.js +++ b/node_modules/@agoric/smart-wallet/src/marshal-contexts.js -@@ -288,7 +288,8 @@ export const makeImportContext = (makePresence = defaultMakePresence) => { +@@ -286,7 +286,8 @@ export const makeImportContext = (makePresence = defaultMakePresence) => { * @param {string} iface */ fromBoard: (slot, iface) => { -- isBoardId(slot) || Fail`bad board slot ${q(slot)}`; -+ // The UI shouldn't error on null board slots, just return a null value. -+ isBoardId(slot) || slot === null || Fail`bad board slot ${q(slot)}`; +- isDefaultBoardId(slot) || Fail`bad board slot ${q(slot)}`; ++ // Don't throw on null slots. ++ isDefaultBoardId(slot) || slot === null || Fail`bad board slot ${q(slot)}`; return provideVal(boardObjects, slot, iface); }, diff --git a/src/service/vaults.ts b/src/service/vaults.ts index e32eafcd..e8654f7c 100644 --- a/src/service/vaults.ts +++ b/src/service/vaults.ts @@ -9,10 +9,14 @@ import { makeFollower, iterateLatest } from '@agoric/casting'; import { appStore } from 'store/app'; import { toast } from 'react-toastify'; import { CapData } from '@endo/marshal'; -import type { Brand, Amount } from '@agoric/ertp/src/types'; -import type { Ratio, PriceQuote } from 'store/vaults'; import { calculateMinimumCollateralization } from '@agoric/inter-protocol/src/vaultFactory/math'; import { CollateralAction, DebtAction } from 'store/adjustVault'; +import type { Brand, Amount } from '@agoric/ertp/src/types'; +import type { Ratio, PriceQuote } from 'store/vaults'; +import type { + AgoricContractInvitationSpec, + ContinuingInvitationSpec, +} from '@agoric/smart-wallet/src/invitations'; type ValuePossessor = { value: T; @@ -182,8 +186,6 @@ type VaultFactoryParamsUpdate = ValuePossessor<{ current: { MinInitialDebt: ValuePossessor> }; }>; -type AgoricInstancesUpdate = ValuePossessor>; - type VaultUpdate = ValuePossessor; export const watchVaultFactory = (netconfigUrl: string) => { @@ -323,16 +325,16 @@ export const makeOpenVaultOffer = async ( ) => { const { importContext, offerSigner } = appStore.getState(); - const invitationSpec = importContext.fromBoard.serialize( - harden({ - source: 'agoricContract', - instancePath: ['VaultFactory'], - callPipe: [ - ['getCollateralManager', [toLock.brand]], - ['makeVaultInvitation'], - ], - }), - ); + const spec: AgoricContractInvitationSpec = { + source: 'agoricContract', + instancePath: ['VaultFactory'], + callPipe: [ + ['getCollateralManager', [toLock.brand]], + ['makeVaultInvitation'], + ], + }; + + const invitationSpec = importContext.fromBoard.serialize(harden(spec)); const serializedToLock = importContext.fromBoard.serialize( toLock, @@ -392,13 +394,13 @@ export const makeAdjustVaultOffer = async ({ }: AdjustParams) => { const { importContext, offerSigner } = appStore.getState(); - const invitationSpec = importContext.fromBoard.serialize( - harden({ - source: 'continuing', - previousOffer: vaultOfferId, - invitationMakerName: 'AdjustBalances', - }), - ); + const spec: ContinuingInvitationSpec = { + source: 'continuing', + previousOffer: vaultOfferId, + invitationMakerName: 'AdjustBalances', + }; + + const invitationSpec = importContext.fromBoard.serialize(harden(spec)); const proposal: Proposal = { give: {}, want: {} }; @@ -446,13 +448,13 @@ export const makeCloseVaultOffer = async ( ) => { const { importContext, offerSigner } = appStore.getState(); - const invitationSpec = importContext.fromBoard.serialize( - harden({ - source: 'continuing', - previousOffer: vaultOfferId, - invitationMakerName: 'CloseVault', - }), - ); + const spec: ContinuingInvitationSpec = { + source: 'continuing', + previousOffer: vaultOfferId, + invitationMakerName: 'CloseVault', + }; + + const invitationSpec = importContext.fromBoard.serialize(harden(spec)); const collateralToWant = collateral ? { diff --git a/yarn.lock b/yarn.lock index e6c8bc24..1fa6909b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,6 +21,11 @@ resolved "https://registry.yarnpkg.com/@agoric/assert/-/assert-0.5.2-dev-669ad6d.0.tgz#91ea15ddd228d2209179103dae1337267baa07e8" integrity sha512-yUPwL6fqdsdtmVdQqw9s6+2O5HXt317GXdzKrMkzqJyEXNEPsFqFHRrsMJoVZZFje3Xi1r37dPVE6i2QSCwcUg== +"@agoric/assert@0.5.2-dev-8cbf697.0+8cbf697": + version "0.5.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/assert/-/assert-0.5.2-dev-8cbf697.0.tgz#ed2fc6adeb5cb4ece77406a7915de24799661cb9" + integrity sha512-xvQgvzB8cnTcqS9tbI3SOpLc7TKA2Ds6CeXW574c/k2Iajc3peRFuWhw5qOce71sIGLaYIqKS7hHhelyMzGp8A== + "@agoric/assert@0.5.2-dev-95a7fa5.0+95a7fa5": version "0.5.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/assert/-/assert-0.5.2-dev-95a7fa5.0.tgz#e356917d629893de59a4dfab86d48af81ab63ca4" @@ -79,6 +84,25 @@ "@endo/promise-kit" "^0.2.52" node-fetch "^2.6.0" +"@agoric/casting@0.3.3-dev-8cbf697.0+8cbf697": + version "0.3.3-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/casting/-/casting-0.3.3-dev-8cbf697.0.tgz#f4d6fc6f986690d53f73af2c3412b9b51cd059f6" + integrity sha512-bbH7l4+xyAHEhhZ9urTVXtNsS4JHEdJeukx/y/a9/aPOs7yzsrFAyarJ4xoZUnMRKqA9LCwY9eMKhfB1mefmWA== + dependencies: + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/spawner" "0.6.4-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@cosmjs/encoding" "0.29.0" + "@cosmjs/proto-signing" "0.29.0" + "@cosmjs/stargate" "0.29.0" + "@cosmjs/tendermint-rpc" "0.29.0" + "@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" + node-fetch "^2.6.0" + "@agoric/cosmic-proto@0.2.2-dev-1adb7a2.0+1adb7a2": version "0.2.2-dev-1adb7a2.0" resolved "https://registry.yarnpkg.com/@agoric/cosmic-proto/-/cosmic-proto-0.2.2-dev-1adb7a2.0.tgz#94ba891f73d74ef985af2032961d05faa9c4475e" @@ -118,6 +142,22 @@ "@endo/marshal" "^0.8.1" "@endo/promise-kit" "^0.2.52" +"@agoric/ertp@0.15.4-dev-8cbf697.0+8cbf697": + version "0.15.4-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/ertp/-/ertp-0.15.4-dev-8cbf697.0.tgz#2a06135f93e771e95dd72388f6af66d15974b599" + integrity sha512-+vy3D91odDKVGZnrdkjM6VHwOw6/DYIn+6aze7RIecoa8QvFtrlmZ1vTJ6gtqoaNiTdPikQdpgJDnJ3fDSHDaQ== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@endo/eventual-send" "^0.16.8" + "@endo/far" "^0.2.14" + "@endo/marshal" "^0.8.1" + "@endo/nat" "^4.1.0" + "@endo/promise-kit" "^0.2.52" + "@agoric/ertp@0.15.4-dev-95a7fa5.0+95a7fa5": version "0.15.4-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/ertp/-/ertp-0.15.4-dev-95a7fa5.0.tgz#6b56ba5083f53e995e326a03f98d964ccb43b6c6" @@ -176,6 +216,28 @@ "@endo/marshal" "^0.8.1" "@endo/promise-kit" "^0.2.52" +"@agoric/governance@0.9.2-dev-8cbf697.0+8cbf697": + version "0.9.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/governance/-/governance-0.9.2-dev-8cbf697.0.tgz#c7d12e01e0bf0cb5f34b8525435e5e9fbac265ea" + integrity sha512-6gNELGuIuxpjW4S9r0wws8AS4dUTrl16yCICVWO8zHOJVEf3WNRA2E+WlszjJHh2alGcNG6/7U8dzBY70GN2Fg== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/ertp" "0.15.4-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/time" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@agoric/vats" "0.13.1-dev-8cbf697.0+8cbf697" + "@agoric/zoe" "0.25.4-dev-8cbf697.0+8cbf697" + "@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.0" + "@endo/promise-kit" "^0.2.52" + "@agoric/governance@0.9.2-dev-95a7fa5.0+95a7fa5": version "0.9.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/governance/-/governance-0.9.2-dev-95a7fa5.0.tgz#40439f2ac8b653cb13ce9b202a6fbf4d132c3d6f" @@ -246,6 +308,31 @@ "@endo/nat" "^4.1.23" "@endo/promise-kit" "^0.2.52" +"@agoric/inter-protocol@0.13.2-dev-8cbf697.0+8cbf697": + version "0.13.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/inter-protocol/-/inter-protocol-0.13.2-dev-8cbf697.0.tgz#296754aa297e020259b5ce715a3e316747aed841" + integrity sha512-Vx/SNT8OpoVRH+XvQ1odVUSBK+BCiRDNO6aj9i7dyA4P0xTCaD5xn88CSGZ4y3/EQnqsJVCHLwiz7HQLaHtjxw== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/ertp" "0.15.4-dev-8cbf697.0+8cbf697" + "@agoric/governance" "0.9.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swingset-liveslots" "0.9.1-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/time" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@agoric/vats" "0.13.1-dev-8cbf697.0+8cbf697" + "@agoric/zoe" "0.25.4-dev-8cbf697.0+8cbf697" + "@endo/bundle-source" "^2.4.2" + "@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/promise-kit" "^0.2.52" + "@agoric/inter-protocol@0.13.2-dev-95a7fa5.0+95a7fa5", "@agoric/inter-protocol@^0.13.2-dev-95a7fa5.0": version "0.13.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/inter-protocol/-/inter-protocol-0.13.2-dev-95a7fa5.0.tgz#325538755412e5860770a13544aa45ecb79eb968" @@ -291,6 +378,16 @@ "@endo/promise-kit" "^0.2.52" jessie.js "^0.3.2" +"@agoric/internal@0.2.2-dev-8cbf697.0+8cbf697": + version "0.2.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/internal/-/internal-0.2.2-dev-8cbf697.0.tgz#dfe1bb937eda3f6cb12afc37a3e8facdbb3c8e8b" + integrity sha512-8UCtImkwUGVfvlUjcXigz/58fYfNM9WrTF0GAow6WUT2suWofpHWsKH1ATZ1mFxyL9MkiENylxjUOfblj9SKqg== + dependencies: + "@endo/eventual-send" "^0.16.8" + "@endo/marshal" "^0.8.1" + "@endo/promise-kit" "^0.2.52" + jessie.js "^0.3.2" + "@agoric/internal@0.2.2-dev-95a7fa5.0+95a7fa5": version "0.2.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/internal/-/internal-0.2.2-dev-95a7fa5.0.tgz#938a0eb192a11b57a2909de3d65d22a699245a42" @@ -336,6 +433,21 @@ "@endo/marshal" "^0.8.1" "@endo/promise-kit" "^0.2.52" +"@agoric/notifier@0.5.2-dev-8cbf697.0+8cbf697": + version "0.5.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/notifier/-/notifier-0.5.2-dev-8cbf697.0.tgz#d171890b0e82a5ea68836316a19effb39bb1bce0" + integrity sha512-8L0ksR+M5TgKcGg/fDt1STC6IB4qEdWEgoJyWBdUlnY3yO89/TFM/Ko6RSUrMcXSQYeyPfPh/Xea7Q8Pef3lqg== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swing-store" "0.8.2-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@endo/eventual-send" "^0.16.8" + "@endo/marshal" "^0.8.1" + "@endo/promise-kit" "^0.2.52" + "@agoric/notifier@0.5.2-dev-95a7fa5.0+95a7fa5": version "0.5.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/notifier/-/notifier-0.5.2-dev-95a7fa5.0.tgz#e357aa45a86632b0530da593da378a5f475a1642" @@ -386,6 +498,14 @@ "@agoric/assert" "0.5.2-dev-669ad6d.0+669ad6d" "@endo/marshal" "^0.8.1" +"@agoric/sharing-service@0.2.7-dev-8cbf697.0+8cbf697": + version "0.2.7-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/sharing-service/-/sharing-service-0.2.7-dev-8cbf697.0.tgz#f3928d82e1380e146b39eb94a7a9993950bf75b6" + integrity sha512-BhA2vtA7JQqwGyf0zKEpfiHp5uSQ8FfTtFSfH9ROYwQhU9tOXpN6jz6Czb7jQXjH3rkE9oYZdiOcZWtWzKj7gA== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@endo/marshal" "^0.8.1" + "@agoric/sharing-service@0.2.7-dev-95a7fa5.0+95a7fa5": version "0.2.7-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/sharing-service/-/sharing-service-0.2.7-dev-95a7fa5.0.tgz#33cf30af6c9b9745fc7b30872f5d2baf0f1e9fcf" @@ -394,7 +514,7 @@ "@agoric/assert" "0.5.2-dev-95a7fa5.0+95a7fa5" "@endo/marshal" "^0.8.1" -"@agoric/smart-wallet@0.4.3-dev-1adb7a2.0+1adb7a2", "@agoric/smart-wallet@^0.4.3-dev-1adb7a2.0": +"@agoric/smart-wallet@0.4.3-dev-1adb7a2.0+1adb7a2": version "0.4.3-dev-1adb7a2.0" resolved "https://registry.yarnpkg.com/@agoric/smart-wallet/-/smart-wallet-0.4.3-dev-1adb7a2.0.tgz#4cc9b5d743e210350f90a4b2df53f0f593388664" integrity sha512-xryExmNhIyZUdGeAe5IPXELyb0ib+9MwbyD9TnaYpi39Rlq9gBci+kjO0L8kbGPRe9VDGx/noAJuw/If7FaTRA== @@ -413,6 +533,25 @@ "@endo/far" "^0.2.14" "@endo/marshal" "^0.8.1" +"@agoric/smart-wallet@^0.4.3-dev-8cbf697.0": + version "0.4.3-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/smart-wallet/-/smart-wallet-0.4.3-dev-8cbf697.0.tgz#5926f69fef4466db166166f39730a2616b6c4ea1" + integrity sha512-ZjTHdRMtA/RBETg2oSxqeobx3jv0MOzypkuFV0QIDnnmmdUjOi1JOF19Y/6s6t2jvOjeTPwXEH3ZnLDDap4AyQ== + dependencies: + "@agoric/casting" "0.3.3-dev-8cbf697.0+8cbf697" + "@agoric/ertp" "0.15.4-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@agoric/vats" "0.13.1-dev-8cbf697.0+8cbf697" + "@agoric/zoe" "0.25.4-dev-8cbf697.0+8cbf697" + "@endo/eventual-send" "^0.16.8" + "@endo/far" "^0.2.14" + "@endo/marshal" "^0.8.1" + "@endo/nat" "^4.1.0" + "@agoric/spawner@0.6.4-dev-1adb7a2.0+1adb7a2": version "0.6.4-dev-1adb7a2.0" resolved "https://registry.yarnpkg.com/@agoric/spawner/-/spawner-0.6.4-dev-1adb7a2.0.tgz#99b015d2be54eaf3445b7532f66d5ba3dc93a8d8" @@ -423,6 +562,16 @@ "@endo/import-bundle" "^0.3.0" "@endo/marshal" "^0.8.1" +"@agoric/spawner@0.6.4-dev-8cbf697.0+8cbf697": + version "0.6.4-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/spawner/-/spawner-0.6.4-dev-8cbf697.0.tgz#a506be4db6599b490fded97eddd7b3374ca14c75" + integrity sha512-iVynMq5Auc9cbMkasfO8F6m7b5VmDksh4eu4QCwPxkoBkaRHOBLFy2x+tIhzQKEUy+HMGhk0/jSCr8nEFPp7sA== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@endo/eventual-send" "^0.16.8" + "@endo/import-bundle" "^0.3.0" + "@endo/marshal" "^0.8.1" + "@agoric/store@0.8.4-dev-1adb7a2.0+1adb7a2": version "0.8.4-dev-1adb7a2.0" resolved "https://registry.yarnpkg.com/@agoric/store/-/store-0.8.4-dev-1adb7a2.0.tgz#9a84d8c967e9bbde5c34a71c0f928c2e6ebdc6b2" @@ -448,6 +597,19 @@ "@endo/promise-kit" "^0.2.52" "@fast-check/ava" "^1.1.3" +"@agoric/store@0.8.4-dev-8cbf697.0+8cbf697": + version "0.8.4-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/store/-/store-0.8.4-dev-8cbf697.0.tgz#1f56172620b7282bc7925078bfe737d12d45b6fa" + integrity sha512-5KYklf9dJhF6LAbJcnHUOIpBNb53112AKEt70RzdYREhLr4mpC88SaaLytQLB3dEjeS/BFXmA/q3SpnH5AF+aQ== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@endo/eventual-send" "^0.16.8" + "@endo/far" "^0.2.14" + "@endo/marshal" "^0.8.1" + "@endo/promise-kit" "^0.2.52" + "@fast-check/ava" "^1.1.3" + "@agoric/store@0.8.4-dev-95a7fa5.0+95a7fa5": version "0.8.4-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/store/-/store-0.8.4-dev-95a7fa5.0.tgz#2c45acb641f49a89137e97aec44981ecd06f8702" @@ -481,6 +643,16 @@ better-sqlite3 "^7.5.0" tmp "^0.2.1" +"@agoric/swing-store@0.8.2-dev-8cbf697.0+8cbf697": + version "0.8.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/swing-store/-/swing-store-0.8.2-dev-8cbf697.0.tgz#3421b1edc192b98e8fe655e7b81c197fcbdb753d" + integrity sha512-jRQtoCNSacY8La26g8DqNSwRsLcw4lvKWBCLkzatOXE0r6HwwDhXLHRvHsrR/Mf+flSwOLddCeouc5QI3UbcoQ== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + better-sqlite3 "^7.5.0" + tmp "^0.2.1" + "@agoric/swing-store@0.8.2-dev-95a7fa5.0+95a7fa5": version "0.8.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/swing-store/-/swing-store-0.8.2-dev-95a7fa5.0.tgz#8df3eec90be636397439f9a89d303f100b550cfd" @@ -491,6 +663,21 @@ better-sqlite3 "^7.5.0" tmp "^0.2.1" +"@agoric/swingset-liveslots@0.9.1-dev-8cbf697.0+8cbf697": + version "0.9.1-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/swingset-liveslots/-/swingset-liveslots-0.9.1-dev-8cbf697.0.tgz#b6c029f9586ed88c9c56a771993e099fd5c7fd24" + integrity sha512-+daUMX4osgsQkf+n5LHyYQxv4rjbPpv4EXYKjRKYHJXm3hSWBZh1vjKOK6uy+Yx62T1g3v7ZBm/d2mCQQkrvGA== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@endo/eventual-send" "^0.16.8" + "@endo/init" "^0.5.52" + "@endo/marshal" "^0.8.1" + "@endo/nat" "^4.1.0" + "@endo/promise-kit" "^0.2.52" + "@agoric/swingset-liveslots@0.9.1-dev-95a7fa5.0+95a7fa5": version "0.9.1-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/swingset-liveslots/-/swingset-liveslots-0.9.1-dev-95a7fa5.0.tgz#63077c34522eaf771a0853dd73ce0cfe09096604" @@ -566,6 +753,37 @@ microtime "^3.1.0" semver "^6.3.0" +"@agoric/swingset-vat@0.30.3-dev-8cbf697.0+8cbf697": + version "0.30.3-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/swingset-vat/-/swingset-vat-0.30.3-dev-8cbf697.0.tgz#434d0bee872d473ffa71da215a527477b7b275d1" + integrity sha512-LxW4cLpEdoNSNsvNlXaY72tRWmk4BpRTfLNp4QPBuw4Wm9q/nYCYeVBNbMZcnCyGH+D9EWd5T3E1jcjP41dgFA== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swing-store" "0.8.2-dev-8cbf697.0+8cbf697" + "@agoric/swingset-liveslots" "0.9.1-dev-8cbf697.0+8cbf697" + "@agoric/time" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@agoric/xsnap" "0.13.3-dev-8cbf697.0+8cbf697" + "@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/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" + anylogger "^0.21.0" + import-meta-resolve "^2.2.1" + microtime "^3.1.0" + semver "^6.3.0" + "@agoric/swingset-vat@0.30.3-dev-95a7fa5.0+95a7fa5": version "0.30.3-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/swingset-vat/-/swingset-vat-0.30.3-dev-95a7fa5.0.tgz#a2cae8c2c5ffa46d4f8d699bea9760ad01c7c35b" @@ -597,6 +815,15 @@ microtime "^3.1.0" semver "^6.3.0" +"@agoric/time@0.2.2-dev-8cbf697.0+8cbf697": + version "0.2.2-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/time/-/time-0.2.2-dev-8cbf697.0.tgz#6c3b2147525d93e2b8d46b912ee930cfe03ef1a5" + integrity sha512-DiERs68f173/ccorHKTGD7rPX4bCZ68J/BCgCFCqMSYcUMzTYlaPBMODaZhaAU5eURLV8rGnaxji3/d2MOlRXg== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@endo/nat" "^4.1.0" + "@agoric/time@0.2.2-dev-95a7fa5.0+95a7fa5": version "0.2.2-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/time/-/time-0.2.2-dev-95a7fa5.0.tgz#96db26bad7956ebdd8197fd3a6fbe8e24f9e865f" @@ -636,6 +863,15 @@ "@agoric/internal" "0.2.2-dev-669ad6d.0+669ad6d" "@agoric/store" "0.8.4-dev-669ad6d.0+669ad6d" +"@agoric/vat-data@0.4.4-dev-8cbf697.0+8cbf697": + version "0.4.4-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/vat-data/-/vat-data-0.4.4-dev-8cbf697.0.tgz#52922f20d9bd4aae716d91458cf2cf4ec1292582" + integrity sha512-TWNKHjvb+FY9J5ZQJeIpHiKcf1g3COb5fVIuzbEyslq0fWZ/LejvfbqscZxdob14gWkI1ZLGMC/OZYzHiNklLw== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/vat-data@0.4.4-dev-95a7fa5.0+95a7fa5": version "0.4.4-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/vat-data/-/vat-data-0.4.4-dev-95a7fa5.0.tgz#e58563b7ae6dab8b743f7a7b0cee6e19f7368fbd" @@ -691,6 +927,30 @@ "@endo/marshal" "^0.8.1" "@endo/promise-kit" "^0.2.52" +"@agoric/vats@0.13.1-dev-8cbf697.0+8cbf697": + version "0.13.1-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/vats/-/vats-0.13.1-dev-8cbf697.0.tgz#2060d64cdd619fe0a45986630cf2968004c04ea4" + integrity sha512-q2DZnuFggYV77k1AnFDJdvZCvn1g9AfzfNaox010av1VHj/1meK21tcVSwdhVARFZIkxZVX/0SQMlJS5x+nYew== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/ertp" "0.15.4-dev-8cbf697.0+8cbf697" + "@agoric/governance" "0.9.2-dev-8cbf697.0+8cbf697" + "@agoric/inter-protocol" "0.13.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/sharing-service" "0.2.7-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/time" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@agoric/zoe" "0.25.4-dev-8cbf697.0+8cbf697" + "@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.0" + "@endo/promise-kit" "^0.2.52" + "@agoric/vats@0.13.1-dev-95a7fa5.0+95a7fa5": version "0.13.1-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/vats/-/vats-0.13.1-dev-95a7fa5.0.tgz#bcf7879311f923aaba52b7ac68779f1edb432a8d" @@ -806,6 +1066,23 @@ glob "^7.1.6" rollup-plugin-string "^3.0.0" +"@agoric/xsnap@0.13.3-dev-8cbf697.0+8cbf697": + version "0.13.3-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/xsnap/-/xsnap-0.13.3-dev-8cbf697.0.tgz#a60fb6ebc58dfda8bf504937f44c628a014d227d" + integrity sha512-wR7G29vIxinhXvsew3ARX4qgftWF5eVWSojXynRw+Z31nRhm4bXzk8dRVoVXN/URhi6Lm6vIkmIcJejl7/Udnw== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@endo/bundle-source" "^2.4.2" + "@endo/eventual-send" "^0.16.8" + "@endo/init" "^0.5.52" + "@endo/netstring" "^0.3.22" + "@endo/promise-kit" "^0.2.52" + "@endo/stream" "^0.3.21" + "@endo/stream-node" "^0.2.22" + glob "^7.1.6" + rollup-plugin-string "^3.0.0" + "@agoric/xsnap@0.13.3-dev-95a7fa5.0+95a7fa5": version "0.13.3-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/xsnap/-/xsnap-0.13.3-dev-95a7fa5.0.tgz#fea2b7f986d449435b0dc7e21ece467f295663ca" @@ -864,6 +1141,27 @@ "@endo/marshal" "^0.8.1" "@endo/promise-kit" "^0.2.52" +"@agoric/zoe@0.25.4-dev-8cbf697.0+8cbf697": + version "0.25.4-dev-8cbf697.0" + resolved "https://registry.yarnpkg.com/@agoric/zoe/-/zoe-0.25.4-dev-8cbf697.0.tgz#1d497dfaca673ec6619de13ff632e74cbd9ba88c" + integrity sha512-xREqzCL8i5UdmJ1qfLotLKXkrJbOUqHxOZIvUMTe9E44MTagI26keFie5Ma9KHCnvrn15NHkZi4JmD9JPDVObg== + dependencies: + "@agoric/assert" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/ertp" "0.15.4-dev-8cbf697.0+8cbf697" + "@agoric/internal" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/notifier" "0.5.2-dev-8cbf697.0+8cbf697" + "@agoric/store" "0.8.4-dev-8cbf697.0+8cbf697" + "@agoric/swingset-vat" "0.30.3-dev-8cbf697.0+8cbf697" + "@agoric/time" "0.2.2-dev-8cbf697.0+8cbf697" + "@agoric/vat-data" "0.4.4-dev-8cbf697.0+8cbf697" + "@endo/bundle-source" "^2.4.2" + "@endo/eventual-send" "^0.16.8" + "@endo/far" "^0.2.14" + "@endo/import-bundle" "^0.3.0" + "@endo/marshal" "^0.8.1" + "@endo/nat" "^4.1.0" + "@endo/promise-kit" "^0.2.52" + "@agoric/zoe@0.25.4-dev-95a7fa5.0+95a7fa5": version "0.25.4-dev-95a7fa5.0" resolved "https://registry.yarnpkg.com/@agoric/zoe/-/zoe-0.25.4-dev-95a7fa5.0.tgz#cbc7a8384d31b0d4bde5262903fbadfd39af8757" From 95f6bbba3db165fe3326619b769f18d6b2be6f03 Mon Sep 17 00:00:00 2001 From: samsiegart Date: Tue, 14 Feb 2023 17:19:14 -0800 Subject: [PATCH 4/4] build: check prettier in CI --- .eslintignore | 4 ++ .github/ISSUE_TEMPLATE/bug_report.md | 14 ++++-- .github/ISSUE_TEMPLATE/work_item.md | 2 - .github/workflows/deploy-inter.yml | 72 ++++++++++++++-------------- .github/workflows/lint-test.yml | 29 +++++------ .prettierignore | 2 + README.md | 17 +++++-- package.json | 4 +- 8 files changed, 81 insertions(+), 63 deletions(-) diff --git a/.eslintignore b/.eslintignore index 3c3629e6..4763394f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,5 @@ node_modules +coverage +dist +patches +yarn.lock diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 38e11935..4c175305 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,29 +4,35 @@ about: Create a report to help us improve title: '' labels: 'bug' assignees: '' - --- ## Describe the bug + A clear and concise description of what the bug is. ## To Reproduce + Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error ## Expected behavior + A clear and concise description of what you expected to happen. ## Platform Environment - - what OS are you using? what version of Node.js? - - is there anything special/unusual about your platform? - - what version of the Agoric-SDK are you using? (run `git describe --tags --always`) + +- what OS are you using? what version of Node.js? +- is there anything special/unusual about your platform? +- what version of the Agoric-SDK are you using? (run `git describe --tags --always`) ## Additional context + Add any other context about the problem here. ## Screenshots + If applicable, add screenshots to help explain your problem, especially for UI interactions. diff --git a/.github/ISSUE_TEMPLATE/work_item.md b/.github/ISSUE_TEMPLATE/work_item.md index 2c177253..32f68415 100644 --- a/.github/ISSUE_TEMPLATE/work_item.md +++ b/.github/ISSUE_TEMPLATE/work_item.md @@ -4,7 +4,6 @@ about: A unit of work that (maybe) needs to be done title: '' labels: 'enhancement' assignees: '' - --- ## What is the Problem Being Solved? @@ -14,4 +13,3 @@ assignees: '' ## Security Considerations ## Test Plan - diff --git a/.github/workflows/deploy-inter.yml b/.github/workflows/deploy-inter.yml index fc381b3a..5ffea0c6 100644 --- a/.github/workflows/deploy-inter.yml +++ b/.github/workflows/deploy-inter.yml @@ -2,7 +2,7 @@ name: Deploy dapp-inter to IPFS on: push: - branches: [ main ] + branches: [main] pull_request: workflow_dispatch: @@ -12,40 +12,40 @@ jobs: permissions: pull-requests: write steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Get current date - id: date - run: echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 + - name: Checkout + uses: actions/checkout@v3 + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d_%H:%m:%S)" >> $GITHUB_OUTPUT + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Build - run: | - find . - yarn install - yarn build + - name: Build + run: | + find . + yarn install + yarn build - - name: Deploy on IPFS - uses: aquiladev/ipfs-action@12cc5d253735dc2894fe19828bd042c8532acc5d #v0.3.1 - id: ipfs - with: - path: ./dist - service: filebase - pinName: 'dapp-inter-testing-${{ steps.date.outputs.date }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}' - filebaseBucket: ${{ secrets.FILEBASE_BUCKET }} - filebaseKey: ${{ secrets.FILEBASE_KEY }} - filebaseSecret: ${{ secrets.FILEBASE_SECRET }} - - name: Convert IPFS Hash - id: ipfsv1 - run: | - echo "v1hash=$(npx --yes cid-tool@3.0.0 base32 ${{ steps.ipfs.outputs.ipfs }})" >> $GITHUB_OUTPUT - - name: Add IPFS info to PR - uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 #v2 - with: - message: | - IPFS hash: `${{ steps.ipfs.outputs.ipfs }}` - IPFS v1 hash: `${{ steps.ipfsv1.outputs.v1hash }}` - [CF](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.cf-ipfs.com) - [DWeb](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.dweb.link) - [4EVERLAND](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.4everland.io) + - name: Deploy on IPFS + uses: aquiladev/ipfs-action@12cc5d253735dc2894fe19828bd042c8532acc5d #v0.3.1 + id: ipfs + with: + path: ./dist + service: filebase + pinName: 'dapp-inter-testing-${{ steps.date.outputs.date }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}' + filebaseBucket: ${{ secrets.FILEBASE_BUCKET }} + filebaseKey: ${{ secrets.FILEBASE_KEY }} + filebaseSecret: ${{ secrets.FILEBASE_SECRET }} + - name: Convert IPFS Hash + id: ipfsv1 + run: | + echo "v1hash=$(npx --yes cid-tool@3.0.0 base32 ${{ steps.ipfs.outputs.ipfs }})" >> $GITHUB_OUTPUT + - name: Add IPFS info to PR + uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1 #v2 + with: + message: | + IPFS hash: `${{ steps.ipfs.outputs.ipfs }}` + IPFS v1 hash: `${{ steps.ipfsv1.outputs.v1hash }}` + [CF](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.cf-ipfs.com) - [DWeb](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.dweb.link) - [4EVERLAND](https://${{ steps.ipfsv1.outputs.v1hash }}.ipfs.4everland.io) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index d438ef3f..acaede4f 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -8,7 +8,7 @@ on: branches: [main] pull_request: schedule: - - cron: "0 12 * * *" + - cron: '0 12 * * *' jobs: build: @@ -17,16 +17,17 @@ jobs: matrix: node-version: [18.x] steps: - - name: Checkout Dapp - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: yarn install - run: yarn install - - name: yarn build - run: yarn build - - run: yarn lint - - name: yarn test - run: yarn test + - name: Checkout Dapp + uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: yarn install + run: yarn install + - name: yarn build + run: yarn build + - name: yarn lint + run: yarn lint + - name: yarn test + run: yarn test diff --git a/.prettierignore b/.prettierignore index 88b3bfce..ab9dbb85 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ dist node_modules yarn.lock +coverage +patches diff --git a/README.md b/README.md index ea4016c8..577b9555 100644 --- a/README.md +++ b/README.md @@ -2,38 +2,45 @@ User application for Agoric Inter Protocol--Vaults, BLD Boost, Liquidations, etc. - ## Development 1. Download and build the latest copy of `agoric-sdk`. + ``` cd agoric-sdk yarn && yarn build ``` 2. Build the local chain if necessary. + ``` cd packages/cosmic-swingset && make scenario2-setup ``` 3. (One-time) Create a private key for local development. + ``` agd keys add YOUR_ACCOUNT_KEY --keyring-backend=test // Your test account. You can name this whatever you want. agd keys add oracle2 --keyring-backend=test // This will be used by scripts later on. ``` + You can save the seed phrase somewhere, or even create a keplr account with it for testing. You can use `agd keys list --keyring-backend=test` to check which keys you've created. -4. Start a local chain with psm, vaults, etc. +4. Start a local chain with psm, vaults, etc. + ``` cd packages/inter-protocol && scripts/start-local-chain.sh YOUR_ACCOUNT_KEY ``` + (May need to `chmod +x start-local-chain.sh` first). 5. Set up the price feeds needed by the vault contracts and UI + ``` cd packages/agoric-cli AGORIC_NET=local test/agops-oracle-smoketest.sh YOUR_ACCOUNT_KEY ``` + If it hangs on `agoric follow`, you can just cancel it as it's made it far enough to create a price feed. If you want, you can manually run the remaining steps in your terminal. 6. Start a local [wallet](https://github.com/Agoric/wallet-app) client server: @@ -43,7 +50,7 @@ cd wallet-app yarn start ``` -Go to settings and select localhost for your network +Go to settings and select localhost for your network Screen Shot 2023-01-23 at 11 57 16 AM @@ -55,13 +62,13 @@ If you created a Keplr account with the seed from YOUR_ACCOUNT_KEY, you should a `yarn install && yarn build` will create a bundled SPA in the `dist` folder that can be served from a web server. You can preview the bundled application by running `yarn preview`. -By default, it will have a network dropdown for choosing between various test networks. +By default, it will have a network dropdown for choosing between various test networks. ![image](https://user-images.githubusercontent.com/8848650/218278636-d9049a84-d14e-4668-8a13-97754313bde1.png) - For production, it's recommended that you use the environment variable `VITE_NETWORK_CONFIG_URL` to preset a real network and hide the dropdown: + ``` VITE_NETWORK_CONFIG_URL=https://.net/network-config yarn build ``` diff --git a/package.json b/package.json index c28bd4fc..035e663e 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "dev": "vite", "build": "tsc && vite build", "preview": "vite preview", - "lint": "eslint src", - "format": "prettier --write . && yarn lint --fix", + "lint": "eslint . && prettier --check .", + "lint:fix": "eslint . --fix && prettier --write .", "test": "vitest", "coverage": "vitest run --coverage", "postinstall": "patch-package"