From 06019bfce3d7d939aca8d04d841193eb733bd372 Mon Sep 17 00:00:00 2001 From: Leszek Stachowski Date: Fri, 19 Jul 2024 14:56:01 +0200 Subject: [PATCH] L2 hotfix (#279) --- .changeset/two-rats-work.md | 6 + .github/workflows/ci.yml | 2 +- docs/command-line-interface/governance.md | 10 +- .../wrappers_Accounts.AccountsWrapper.md | 2 +- ...appers_Attestations.AttestationsWrapper.md | 2 +- ...nParameters.BlockchainParametersWrapper.md | 2 +- ...Wrapper.CeloDistributionScheduleWrapper.md | 8 +- ...ningSlasher.DoubleSigningSlasherWrapper.md | 2 +- ..._DowntimeSlasher.DowntimeSlasherWrapper.md | 2 +- .../wrappers_Election.ElectionWrapper.md | 2 +- ...appers_EpochRewards.EpochRewardsWrapper.md | 2 +- .../classes/wrappers_Escrow.EscrowWrapper.md | 2 +- ...testations.FederatedAttestationsWrapper.md | 2 +- ...toryWrapper.FeeCurrencyDirectoryWrapper.md | 2 +- ...listWrapper.FeeCurrencyWhitelistWrapper.md | 2 +- .../wrappers_FeeHandler.FeeHandlerWrapper.md | 2 +- ..._GasPriceMinimum.GasPriceMinimumWrapper.md | 2 +- ...ppers_GoldTokenWrapper.GoldTokenWrapper.md | 2 +- .../wrappers_Governance.GovernanceWrapper.md | 212 ++++-- .../wrappers_LockedGold.LockedGoldWrapper.md | 2 +- ...appers_OdisPayments.OdisPaymentsWrapper.md | 2 +- .../wrappers_Reserve.ReserveWrapper.md | 2 +- ...pers_SortedOracles.SortedOraclesWrapper.md | 2 +- ...s_StableTokenWrapper.StableTokenWrapper.md | 2 +- .../wrappers_Validators.ValidatorsWrapper.md | 2 +- .../wrappers_Governance.ProposalStage.md | 12 +- .../enums/wrappers_Governance.VoteValue.md | 8 +- .../wrappers_Governance.GovernanceConfig.md | 12 +- .../wrappers_Governance.HotfixRecord.md | 23 +- .../wrappers_Governance.L1HotfixRecord.md | 43 ++ ...pers_Governance.ParticipationParameters.md | 8 +- .../wrappers_Governance.ProposalMetadata.md | 10 +- .../wrappers_Governance.ProposalRecord.md | 16 +- .../wrappers_Governance.UpvoteRecord.md | 4 +- .../wrappers_Governance.VoteRecord.md | 12 +- .../interfaces/wrappers_Governance.Voter.md | 6 +- .../interfaces/wrappers_Governance.Votes.md | 6 +- .../modules/wrappers_Governance.md | 15 +- packages/cli/package.json | 5 +- packages/cli/src/base.ts | 4 +- .../commands/governance/approve-l2.test.ts | 674 ++++++++++++++++++ .../src/commands/governance/approve.test.ts | 6 +- .../cli/src/commands/governance/approve.ts | 136 +++- .../governance/executehotfix-l2.test.ts | 337 +++++++++ .../src/commands/governance/executehotfix.ts | 36 +- .../cli/src/commands/governance/hashhotfix.ts | 7 +- .../governance/preparehotfix-l2.test.ts | 104 +++ .../src/commands/governance/preparehotfix.ts | 36 +- packages/cli/src/commands/governance/show.ts | 4 + .../cli/src/commands/lockedgold/lock.test.ts | 4 +- .../__snapshots__/contracts-l2.test.ts.snap | 104 +-- .../cli/src/commands/network/info-l2.test.ts | 2 +- .../commands/network/parameters-l2.test.ts | 16 +- .../src/commands/network/whitelist-l2.test.ts | 7 +- packages/cli/src/test-utils/chain-setup.ts | 14 +- packages/cli/src/test-utils/cliUtils.ts | 5 + packages/cli/src/utils/checks.ts | 51 +- packages/cli/src/utils/cli.ts | 4 + packages/dev-utils/package.json | 2 +- packages/dev-utils/src/anvil-test.ts | 4 +- packages/dev-utils/tsconfig.json | 2 +- packages/sdk/contractkit/package.json | 2 +- packages/sdk/contractkit/src/kit.test.ts | 2 +- .../contractkit/src/web3-contract-cache.ts | 2 +- .../CeloDistributionScheduleWrapper.ts | 14 +- .../FeeCurrencyDirectoryWrapper.test.ts | 26 +- .../src/wrappers/Governance-l2.test.ts | 29 + .../src/wrappers/Governance.test.ts | 41 ++ .../contractkit/src/wrappers/Governance.ts | 72 +- yarn.lock | 31 +- 70 files changed, 1899 insertions(+), 337 deletions(-) create mode 100644 .changeset/two-rats-work.md create mode 100644 docs/sdk/contractkit/interfaces/wrappers_Governance.L1HotfixRecord.md create mode 100644 packages/cli/src/commands/governance/approve-l2.test.ts create mode 100644 packages/cli/src/commands/governance/executehotfix-l2.test.ts create mode 100644 packages/cli/src/commands/governance/preparehotfix-l2.test.ts create mode 100644 packages/sdk/contractkit/src/wrappers/Governance-l2.test.ts diff --git a/.changeset/two-rats-work.md b/.changeset/two-rats-work.md new file mode 100644 index 000000000..945bda038 --- /dev/null +++ b/.changeset/two-rats-work.md @@ -0,0 +1,6 @@ +--- +'@celo/contractkit': minor +'@celo/celocli': minor +--- + +Adds support for <1.5.0.0 and >=1.5.0.0 Governance contract version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40bf2a5e1..6c3c7d9ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,7 +248,7 @@ jobs: version: ${{ env.SUPPORTED_FOUNDRY_VERSION }} - name: Run tests run: | - yarn workspace @celo/celocli test --coverage + yarn workspace @celo/celocli test-ci --coverage - name: Verify that a new account can be created run: | yarn workspace @celo/celocli run celocli account:new diff --git a/docs/command-line-interface/governance.md b/docs/command-line-interface/governance.md index 1ecf88de1..cc652dc8e 100644 --- a/docs/command-line-interface/governance.md +++ b/docs/command-line-interface/governance.md @@ -32,7 +32,8 @@ Approve a dequeued governance proposal (or hotfix) ``` USAGE $ celocli governance:approvehotfix --from [--gasCurrency ] [--globalHelp] - [--proposalID | --hotfix ] [--useMultiSig] + [--proposalID | --hotfix ] [--useMultiSig] [--type + approver|securityCouncil ] FLAGS --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) Approver's @@ -46,6 +47,11 @@ FLAGS flags --hotfix= Hash of hotfix proposal --proposalID= UUID of proposal to approve + --type=