-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* do registry additions in sequence * do parsing of proposals additions in sequence * add changeset * enter beta mode * Version Packages (beta) (#10816) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Complete beta mode * add feedback about proposal transaction parsing * ensure we clean before building and that cli is packed properly * Version Packages (beta) (#10820) * do registry additions in sequence * do parsing of proposals additions in sequence * add changeset * enter beta mode * Version Packages (beta) (#10816) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Complete beta mode * add feedback about proposal transaction parsing * Version Packages (beta) --------- Co-authored-by: Aaron DeRuvo <aaron@clabs.co> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * registry mapping updates are fine to do together * add a minor changeset just so beta gets bump * Version Packages (beta) (#10825) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * should fix pushing tags issue * Revert "Remove granda mento + metatransaction wallet (#10822)" This reverts commit 9ab9d00. * rollback * Version Packages (beta) (#10826) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * remove beta only changeset * Complete beta mode --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b6a5215
commit 041fc92
Showing
173 changed files
with
7,290 additions
and
3,093 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@celo/governance': patch | ||
--- | ||
|
||
Turn back on parallel registry updating for governance proposal views |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@celo/governance': patch | ||
'@celo/celocli': patch | ||
--- | ||
|
||
Add textual feedback about parsing proposal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@celo/governance': patch | ||
--- | ||
|
||
Fix Proposal View Regression when it includes proxy updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"mode": "exit", | ||
"tag": "beta", | ||
"initialVersions": { | ||
"@celo/celotool": "2.0.0", | ||
"@celo/celocli": "3.1.1", | ||
"@celo/dev-utils": "0.0.1", | ||
"@celo/env-tests": "1.0.2", | ||
"@celo/metadata-crawler": "0.0.3", | ||
"@celo/protocol": "1.0.2", | ||
"@celo/base": "6.0.0", | ||
"@celo/connect": "5.1.1", | ||
"@celo/contractkit": "5.2.1", | ||
"@celo/cryptographic-utils": "5.0.6", | ||
"@celo/explorer": "5.0.6", | ||
"@celo/governance": "5.0.6", | ||
"@celo/keystores": "5.0.6", | ||
"@celo/network-utils": "5.0.5", | ||
"@celo/phone-utils": "6.0.0", | ||
"@celo/transactions-uri": "5.0.6", | ||
"@celo/utils": "5.0.6", | ||
"@celo/wallet-base": "5.1.1", | ||
"@celo/wallet-hsm": "5.1.1", | ||
"@celo/wallet-hsm-aws": "5.1.1", | ||
"@celo/wallet-hsm-azure": "5.1.1", | ||
"@celo/wallet-hsm-gcp": "5.1.1", | ||
"@celo/wallet-ledger": "5.1.1", | ||
"@celo/wallet-local": "5.1.1", | ||
"@celo/wallet-remote": "5.1.1", | ||
"@celo/wallet-rpc": "5.1.1", | ||
"@celo/typescript": "0.0.1" | ||
}, | ||
"changesets": [ | ||
"cool-waves-switch", | ||
"few-cycles-doubt", | ||
"light-buses-love", | ||
"long-mangos-poke", | ||
"loud-tips-design", | ||
"popular-numbers-fly" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Address } from '@celo/base/lib/address' | ||
import { newKitFromWeb3 } from '@celo/contractkit' | ||
import { assumeOwnership } from '@celo/contractkit/lib/test-utils/transferownership' | ||
import { GrandaMentoWrapper } from '@celo/contractkit/lib/wrappers/GrandaMento' | ||
import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' | ||
import BigNumber from 'bignumber.js' | ||
import Web3 from 'web3' | ||
import { testLocally } from '../../test-utils/cliUtils' | ||
import Cancel from './cancel' | ||
import Propose from './propose' | ||
|
||
testWithGanache('grandamento:cancel cmd', (web3: Web3) => { | ||
const kit = newKitFromWeb3(web3) | ||
let grandaMento: GrandaMentoWrapper | ||
const newLimitMin = new BigNumber('1000') | ||
const newLimitMax = new BigNumber('1000000000000') | ||
let accounts: Address[] = [] | ||
|
||
const increaseLimits = async () => { | ||
await grandaMento | ||
.setStableTokenExchangeLimits('StableToken', newLimitMin.toString(), newLimitMax.toString()) | ||
.sendAndWaitForReceipt() | ||
} | ||
|
||
beforeAll(async () => { | ||
accounts = await web3.eth.getAccounts() | ||
kit.defaultAccount = accounts[0] | ||
grandaMento = await kit.contracts.getGrandaMento() | ||
}) | ||
|
||
beforeEach(async () => { | ||
await assumeOwnership(web3, accounts[0]) | ||
await increaseLimits() | ||
// create mock proposal | ||
await testLocally(Propose, [ | ||
'--from', | ||
accounts[0], | ||
'--sellCelo', | ||
'true', | ||
'--stableToken', | ||
'cUSD', | ||
'--value', | ||
'10000', | ||
]) | ||
}) | ||
|
||
describe('cancel', () => { | ||
it('left no proposal', async () => { | ||
await testLocally(Cancel, ['--from', accounts[0], '--proposalID', '1']) | ||
const activeProposals = await grandaMento.getActiveProposalIds() | ||
expect(activeProposals).toEqual([]) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { flags } from '@oclif/command' | ||
import { BaseCommand } from '../../base' | ||
import { newCheckBuilder } from '../../utils/checks' | ||
import { displaySendTx } from '../../utils/cli' | ||
import { Flags } from '../../utils/command' | ||
|
||
export default class Cancel extends BaseCommand { | ||
static description = 'Cancels a Granda Mento exchange proposal' | ||
|
||
static flags = { | ||
...BaseCommand.flags, | ||
from: Flags.address({ | ||
required: true, | ||
description: 'The address allowed to cancel the proposal', | ||
}), | ||
proposalID: flags.string({ | ||
required: true, | ||
exclusive: ['account', 'hotfix'], | ||
description: 'UUID of proposal to view', | ||
}), | ||
} | ||
|
||
async run() { | ||
const grandaMento = await this.kit.contracts.getGrandaMento() | ||
|
||
const res = this.parse(Cancel) | ||
const proposalID = res.flags.proposalID | ||
|
||
await newCheckBuilder(this).grandaMentoProposalExists(proposalID).runChecks() | ||
|
||
await displaySendTx( | ||
'cancelExchangeProposal', | ||
grandaMento.cancelExchangeProposal(proposalID), | ||
undefined, | ||
'ExchangeProposalCancelled' | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { Address } from '@celo/base/lib/address' | ||
import { newKitFromWeb3 } from '@celo/contractkit' | ||
import { assumeOwnership } from '@celo/contractkit/lib/test-utils/transferownership' | ||
import { GrandaMentoWrapper } from '@celo/contractkit/lib/wrappers/GrandaMento' | ||
import { testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' | ||
import BigNumber from 'bignumber.js' | ||
import Web3 from 'web3' | ||
import { testLocally } from '../../test-utils/cliUtils' | ||
import Execute from './execute' | ||
import Propose from './propose' | ||
|
||
testWithGanache('grandamento:execute cmd', (web3: Web3) => { | ||
const kit = newKitFromWeb3(web3) | ||
let grandaMento: GrandaMentoWrapper | ||
const newLimitMin = new BigNumber('1000') | ||
const newLimitMax = new BigNumber('1000000000000') | ||
let accounts: Address[] = [] | ||
const dateNowOriginal = Date.now | ||
let originalNoSyncCheck: string | undefined | ||
|
||
const increaseLimits = () => { | ||
return grandaMento | ||
.setStableTokenExchangeLimits('StableToken', newLimitMin.toString(), newLimitMax.toString()) | ||
.sendAndWaitForReceipt() | ||
} | ||
|
||
const createExchangeProposal = () => { | ||
// create mock proposal | ||
return testLocally(Propose, [ | ||
'--from', | ||
accounts[0], | ||
'--sellCelo', | ||
'true', | ||
'--stableToken', | ||
'cUSD', | ||
'--value', | ||
'10000', | ||
]) | ||
} | ||
|
||
const approveExchangeProposal = async (proposalID: number | string) => { | ||
await grandaMento.setApprover(accounts[0]).sendAndWaitForReceipt() | ||
await grandaMento.approveExchangeProposal(proposalID).sendAndWaitForReceipt() | ||
} | ||
|
||
const timeTravelDateAndChain = async (seconds: number) => { | ||
await timeTravel(seconds, web3) | ||
jest.useFakeTimers().setSystemTime(dateNowOriginal() + seconds * 1000) | ||
// Otherwise contractkit complains there is a difference between Date.now() | ||
// and the timestamp of the last block | ||
process.env.NO_SYNCCHECK = 'true' | ||
} | ||
|
||
beforeAll(async () => { | ||
accounts = await web3.eth.getAccounts() | ||
kit.defaultAccount = accounts[0] | ||
grandaMento = await kit.contracts.getGrandaMento() | ||
originalNoSyncCheck = process.env.NO_SYNCCHECK | ||
}) | ||
|
||
afterEach(() => { | ||
process.env.NO_SYNCCHECK = originalNoSyncCheck | ||
}) | ||
|
||
beforeEach(async () => { | ||
await assumeOwnership(web3, accounts[0]) | ||
await increaseLimits() | ||
await createExchangeProposal() | ||
// Approve it | ||
await approveExchangeProposal(1) | ||
// Wait the veto period plus some extra time to be safe | ||
await timeTravelDateAndChain((await grandaMento.vetoPeriodSeconds()).toNumber() + 1000) | ||
}) | ||
|
||
describe('execute', () => { | ||
it('executes the proposal', async () => { | ||
await testLocally(Execute, ['--from', accounts[0], '--proposalID', '1']) | ||
const activeProposals = await grandaMento.getActiveProposalIds() | ||
expect(activeProposals).toEqual([]) | ||
}) | ||
|
||
it('fails if the exchange proposal is not executable', async () => { | ||
// Create a proposal with proposalID 2, but don't wait the veto period | ||
await createExchangeProposal() | ||
await approveExchangeProposal(2) | ||
await expect( | ||
testLocally(Execute, ['--from', accounts[0], '--proposalID', '2']) | ||
).rejects.toThrow() | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.