-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle multiple econgov invitations due to ec changes #131
Conversation
Deploying dapp-econ-gov with Cloudflare Pages
|
src/lib/wallet.ts
Outdated
const idA = a[0].split('-')[1]; | ||
const idB = b[0].split('-')[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
offerIds aren't guaranteed to be of the form xxx-number
. They can be any string or number.
This code has to handle offerIds from other clients.
I think filtering on instance will find the invitation you're looking for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tested on emerynet with EC account and it said I could vote 👍
- Tested on mainnet with non-EC account and it said I couldn't vote 👍
Had one non-blocking question and one non-blocking suggestion but otherwise LGTM
@@ -6,6 +6,9 @@ export default mergeConfig( | |||
viteConfig, | |||
defineConfig({ | |||
test: { | |||
deps: { | |||
inline: ['@agoric/rpc'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://vitest.dev/config/#server-deps-inline
Vite will process inlined modules. This could be helpful to handle packages that ship .js in ESM format (that Node can't handle).
There were some agoric dependencies which imported file like so
import x from 'foo';
but vitest by default would not accept anything other than
import x from 'foo.js';
this config fixed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks good to know. I wonder if this is fixed in the latest @agoric/rpc
versions with Agoric/ui-kit#76, this dapp is using some pretty old versions. But that's a separate issue.
src/lib/wallet.test.js
Outdated
import { inferInvitationStatus } from './wallet'; | ||
import { LoadStatus } from './rpc'; | ||
|
||
const createMock = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rename this to createMockWallet
or something similar, and instead of mock
s below, mockWallet
or such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing tests!
f97f9d7
to
d3360c2
Compare
closes: #132
This PR changes the inferInvitationStatus function to be able to handle multiple invitations from the economicCommittee and economicCommitteeCharter contract.
This is done by filtering the invitations on the basis of the contract instance, which is updated whenever the new invitations are sent