-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature: Add admin governance plugin client #124
base: develop
Are you sure you want to change the base?
Conversation
modules/client/examples.md
Outdated
const context = new Context(contextParams); | ||
const contextPlugin: ContextPlugin = ContextPlugin.fromContext(context); | ||
|
||
const client = new ClientAdmin(contextPlugin); |
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.
ClientAdmin or AdminClient? Probably the current is consistent with the rest but I see the upcoming MultisigClient, OvoteClient, TokenVotingClient... making more sense :-/
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.
Okay, we can change it here and make a task to change it everywhere
modules/client/examples.md
Outdated
const queryParams: IProposalQueryParams = { | ||
skip: 0, // optional | ||
limit: 10, // optional, |
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.
Didn't we say that subgraph doesn't allow pagination?
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.
Well this is not a pagination, we cannot specify a page because we can't have the total amount of entries of a particular object, for example proposals. We can add a variable to count the number of proposals, the problem that we cannot have the total amount of proposals in a specific state, because the states mainly depend on the current time so from subgraph we cannot detect when a proposal passes from a pending
state to a active
state or when it passes from an active
state to succeded
or defeated
, because this changes depend on the startDate
and endDate
of the proposal, and there is no way of tracking that in subgraph.
This was what the UI requested and what the task that we closed was about
modules/client/examples.md
Outdated
/* | ||
[ | ||
{ | ||
id: "0x12345...", |
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.
This is inconsistent with the proposal ID's used elsewhere, now bigints
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 know, but the subgraph is using pluginAdddress_proposalId
as id
because it has to be unique, the bigint proposal ID is in the field proposalId
}; | ||
|
||
type ProposalBase = { | ||
id: string; |
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.
id? or proposal id below?
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.
id = pluginAddress_proposalId
, has to be unique on subgraph
plugin: { | ||
address: string; | ||
}; | ||
proposalId: string; |
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.
Same
const metadataString = await this.ipfs.fetchString(metadataCid); | ||
const metadata = JSON.parse(metadataString) as ProposalMetadata; | ||
return toAdminProposal(adminProposal, metadata); | ||
// TODO: Parse and validate schema |
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.
Do we need a follow up task?
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.
If we merge this one first I'll add the validation on the validation branch, if we merge the validation branch first i'll add it on this branch
e90bfd7
to
0480d67
Compare
0480d67
to
f031958
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
Create a client for the admin governance plugin
Task: APP-1315
Type of change
Checklist:
CHANGELOG.md
file in the root folder of the package after the [UPCOMING] title and before the latest version.