Skip to content

Commit

Permalink
test(Profile): fork test to check reward and side effects (#301)
Browse files Browse the repository at this point in the history
* restructure

* add profile contract

* add storage log

* fix staking test

* fix fixture

* Revert "fix fixture"

This reverts commit f53277e.

* fix hardhat deploy path

* fix deploy script

* rollback initializerV1

* restructure profile contract

* fix fixture

* fix dependent test

* fix dependent test

* fix: profile execApply

* fix hardhat deploy src path

* rollback NON_VALIDATOR slash type

* follow new code convention

* feat: support change admin address

* fix: inheritance graph

* fix: fix test setup

* add dev comment

* fix rebase issue

* rename for convention

* add enum for custom error

* udvt TPoolId

* Revert "udvt TPoolId"

This reverts commit 0f2c107.

* distinguish poolId vs consensus

* declare TPoolId type

* remove mockup contract

* remove bridge operator change method

* rename interface param

* remove comment

* refactor

* revert casting in coinbase

* Remove TPoolId. Using TConsensus.

* fix test

* remove public vars

* remove more public vars

* remove redundant code

* wrap all external method to TConsensus type

* fix config

* fix test init

* fix mock

* fix test

* fix test

* add comment

* fix helper

* restructure

* fix edge case

* fix conventions

* add docs

* fix: foundry config

* chore: fix conventions

* fix: remove bridge voter

* fix: change inheritance tree

* Merge branch 'feat/fast-finality' into feat/profile

* fix: fix test setup

* Merge branch 'feat/bridge-admin-rebase' into feat/profile

* fix test after merging

* chore: add TODO tag

* tmp disable forge test

* fix fixture

* update ci

* Continue merge branch 'testnet' into feat/profile

* fix test setup

* fix more test setup

* fix test

* fix test & improve conf test

* refactor initializer

* apply initializer for test suites

* fix fast finality test

* fix initializers

* chore: resolve conflict

* feat(Profile): remove unused method, fix execApplyCandidate

* feat(Profile, Staking): require pubkey at apply candidate, fix init test

* test(Profile): fix other dependent tests

* feat: merge 'feat/profile

* chore: fix test

* tmp: add fork tests

* feat(ValidatorSet): recover slot shifted

* feat: remove log & minor refactor

* feat: update more tests

* feat: add test share reward

* chore: resolve low-level call warning

* fix(Profile): handler proper change address

* fix(Profile): handle setter for _consensus2Id

* chore: remove bridge-v2 scripts

* fix(Profile): cherry-pick fix from 'test/feat/profile'

* feat: add testFork_ShareSameSameReward_BeforeAndAfterUpgrade

* fix(SlashFastFinality): fix wrapper for consensus

* fix(SlashFastFinality): fix wrapper for consensus

* chore: resolve low-level call warning

* chore: remove bridge test

* temp(*): rename to cid, pid, _shadowed**

* feat(ValidatorSet): cached admin

* feat(Profile, ValidatorSet): handle execChangeAdminAddress

* feat(Staking): rename admin to `__shadowPoolAdmin`

* feat(Profile): handle change treasury, fix missing rename

* feat: testFork_AfterUpgrade_WrapUpEpochAndNonWrapUpEpoch_ChangeAdmin

* fix: fix test

* test(Profile): test change the addresses

* test: update more tests

* chore(Validator): rename to *ById suffix

* chore: rename `_convert*C2P`

* chore(Validator): remove old version contract

* chore(docs): write natspecs doc for struct

* test: add testFork_AfterUpgraded_RevertWhen_ReapplySameAddress_Renounce

* chore(*): remove `_` for consistent var names

* chore(docs): NatSpecs for __css2cid

* chore: remove compiler warning

* feat(TrustedOrg): handle change consensus for Trusted Org

* feat(SlashIndicator): remove code related to bridge

* chore: clean up PR, remove unrelated files

* test: add testFork_NotReceiveReward_BeforeAndAfterUpgraded_execEmergencyExit

* test: testFork_AsTrustedOrg_AfterUpgraded_AfterChangeConsensus_execEmergencyExit

* format: minor format

* test: fix slash and maintenance test (should not be jail when slash tier 1)

* fix(Staking): fix inaccurate shifted gap

* chore(ValidatorSet): consist interface

* chore(ValidatorSet, Staking): move callbacks to separate files

* chore(ValidatorSet): refactor callbacks

* chore: remove log

* test: fix commission rate in applying candidate

* fix(TrustedOrg): remove onlyAdmin in initV2, fix test

* test: fix test after restrict not allowing rejoin in Profile

* test: fix more test

* feat(RoninTO): fix bug when change consensus in RoninTO

* test(TO): test renounce and emergencyExit

* chore: fix rebase issue

* chore: fix rebase issue

* fix(RoninTO): delete deprecated storage

* chore: rename consensus to cid

* fix(GovernanceAdmin): fix emergency exit typehash

* test(*): fix deprecated voter for test setup

* feat(RoninTO): return address(0) for bridge voter

* chore(debug): debug maintenance test

* chore(debug): maintenance test

* chore: fix typo

* chore: fix deprecatedVoter in test

* feat(RoninTO): rename for consistency

* feat: testFork_AfterUpgraded_WithdrawableFund_execEmergencyExit

* test: fix emergency exit test

* feat(Validator): better handling emergency exit revert

* feat: add roninTO tests

* feat(EmergencyExit): revert to original typehash

* fix: fix test ApplyValidatorCandidateBefore_AddNewTrustedOrgAfter

* fix: enhance testFork_AfterUpgraded_AddNewTrustedOrgBefore_ApplyValidatorCandidateAfter

* fix: enhance testFork_AfterUpgraded_ApplyValidatorCandidateBefore_AddNewTrustedOrgAfter

* feat: add more test cases

* fix(Profile); rename check to require

* fix: enhance test

* fix: regard re-add a renounced trusted org as success

* feat: add mainnet addresses & remove log

* feat: migrate registry for renounced candidates

* fix: import migration of mainnet and testnet to test

* Revert "feat: remove log"

This reverts partially commit 491db30.

* chore: remove log in source code

* feat(Profile): fix migration

* chore: log gasleft

* feat(Profile): fix migration

* chore: fix rebase issue

* chore: fix test setup

* config: enable literal content for RoninValidatorSet deployment

* ci: enable on "feat/**" branch

* test: fix mainnet test

* test: roll up block number on testnet to after upgrading Maintenance

---------

Co-authored-by: nxqbao <[email protected]>
  • Loading branch information
TuDo1403 and nxqbao authored Nov 27, 2023
1 parent 1cafa6a commit dc9cf8c
Show file tree
Hide file tree
Showing 5 changed files with 1,078 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- mainnet
- testnet
- "release/**"
- "feat/**"

permissions:
packages: read
Expand Down
1 change: 0 additions & 1 deletion contracts/multi-chains/RoninTrustedOrganization.sol
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ contract RoninTrustedOrganization is IRoninTrustedOrganization, HasProxyAdmin, H
return getTrustedOrganizationAt(i);
}
}
revert ErrQueryForNonExistentConsensusAddress();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ libs = [

# See more config options https://github.com/foundry-rs/foundry/tree/master/config

solc = '0.8.21'
solc = '0.8.22'
extra_output = ["devdoc", "userdoc", "storagelayout"]
evm_version = 'istanbul'
cache_path = 'cache_foundry'
Expand Down
Loading

0 comments on commit dc9cf8c

Please sign in to comment.