Skip to content

Commit

Permalink
Merge pull request #70 from Agoric/new-invitation-spec
Browse files Browse the repository at this point in the history
feat: use new invitation spec
  • Loading branch information
samsiegart authored Feb 15, 2023
2 parents a69c2f2 + 95f6bbb commit bb5a1dd
Show file tree
Hide file tree
Showing 13 changed files with 414 additions and 119 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
node_modules
coverage
dist
patches
yarn.lock
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/work_item.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -14,4 +13,3 @@ assignees: ''
## Security Considerations

## Test Plan

72 changes: 36 additions & 36 deletions .github/workflows/deploy-inter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy dapp-inter to IPFS

on:
push:
branches: [ main ]
branches: [main]
pull_request:
workflow_dispatch:

Expand All @@ -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 [email protected] 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 [email protected] 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)
29 changes: 15 additions & 14 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [main]
pull_request:
schedule:
- cron: "0 12 * * *"
- cron: '0 12 * * *'

jobs:
build:
Expand All @@ -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
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist
node_modules
yarn.lock
coverage
patches
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

<img width="410" alt="Screen Shot 2023-01-23 at 11 57 16 AM" src="https://user-images.githubusercontent.com/8848650/214137346-b42942db-3b93-413a-991e-c77e2a30d6f1.png">

Expand All @@ -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://<PRODUCTION-NETWORK>.net/network-config yarn build
```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
},

Loading

0 comments on commit bb5a1dd

Please sign in to comment.