Skip to content
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

Support governance proposals/hotfixes in contractkit #1570

Closed
wants to merge 71 commits into from

Conversation

yorhodes
Copy link
Contributor

@yorhodes yorhodes commented Nov 3, 2019

Description

Adds interfaces to src/wrappers/Governance for interacting with proposals/hotfixes
Adds src/governance/proposals for constructing proposal/hotfix inputs

Tested

Added src/wrappers/Governance.test to test e2e proposal functionality
Hotfix tests disabled until #1737 is fixed

Other changes

Adds timeTravel to test-utils/test-ganache
Updates, simplifies, and dedupes type converters in src/wrappers/BaseWrapper
Migrates util functionality to /packages/utils/src/address
Adds positional args to src/explorer/block-explorer/CallDetails interface

@yorhodes yorhodes force-pushed the yorhodes/contract-upgrades branch from c7f18cf to 2e823a9 Compare November 3, 2019 22:19
@yorhodes yorhodes requested a review from jmrossy as a code owner November 4, 2019 23:38
@yorhodes yorhodes force-pushed the yorhodes/contract-upgrades branch from 744bfa5 to 9051b02 Compare November 5, 2019 15:12
@yorhodes yorhodes requested a review from asaj as a code owner November 7, 2019 21:01
packages/contractkit/src/explorer/block-explorer.ts Outdated Show resolved Hide resolved
packages/contractkit/src/governance/proposals.ts Outdated Show resolved Hide resolved
packages/contractkit/src/governance/proposals.ts Outdated Show resolved Hide resolved
}

type ProposalTxParams = Pick<ProposalTransaction, 'to' | 'value'>
export class ProposalBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that these two technically do two different things, but what do you think about merging ProposalUtility and ProposalBuilder?

packages/contractkit/src/wrappers/Governance.test.ts Outdated Show resolved Hide resolved
packages/contractkit/src/wrappers/Governance.test.ts Outdated Show resolved Hide resolved
packages/contractkit/src/wrappers/Governance.ts Outdated Show resolved Hide resolved
packages/utils/src/address.ts Outdated Show resolved Hide resolved
uint256 tally = 0;
uint256 n = numberValidatorsInCurrentSet();
for (uint256 idx = 0; idx < n; idx++) {
address validator = validatorAddressFromCurrentSet(idx);
if (hotfixes[hash].whitelisted[validator]) {
if (isHotfixWhitelistedBy(hash, validator)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be off topic and I don't fully remember, but I believe the validator set contains the addresses of the validating keys, but is that the keys we expect validators to whitelist with? cc @asaj

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix in a followup PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #1832

@nambrot nambrot removed their assignment Nov 18, 2019
@yorhodes yorhodes force-pushed the yorhodes/contract-upgrades branch from dafede4 to f0d5274 Compare November 22, 2019 05:14
@yorhodes yorhodes force-pushed the yorhodes/contract-upgrades branch from f0d5274 to 6f3c771 Compare November 22, 2019 05:26
@yorhodes
Copy link
Contributor Author

Closing for merge of #2139

@yorhodes yorhodes closed this Dec 23, 2019
@yorhodes yorhodes deleted the yorhodes/contract-upgrades branch December 23, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create ContractWrapper for Governance
7 participants