state surgery: test infra#1565
Conversation
|
cc62959 to
6c1d163
Compare
Codecov Report
@@ Coverage Diff @@
## sc/surgery-testing #1565 +/- ##
=====================================================
Coverage ? 73.82%
=====================================================
Files ? 67
Lines ? 2227
Branches ? 326
=====================================================
Hits ? 1644
Misses ? 583
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
| }) | ||
| } | ||
|
|
||
|
|
| let eoas: StateDump | ||
| before(async () => { | ||
| await testEnv.init() | ||
| eoas = testEnv.surgeryDataSources.dump.filter(a => eoaClassifier(a, testEnv.surgeryDataSources)) |
There was a problem hiding this comment.
It would be better to do:
testEnv.surgeryDataSources.dump.filter((acc) => {
return classify(a, testEnv.surgeryDataSources))
})
So that we follow the same classification algorithm (only matching one classification). I don't think this actually matters for this specific test, but it will matter for other tests and we should be consistent.
There was a problem hiding this comment.
I have a feeling we will need this function in multiple places. Could abstract into:
function findAccountsByType(dump: StateDump, accountType: AccountType): Account[]
| import { AccountType, StateDump } from '../../scripts/types' | ||
| import { classifiers } from '../../scripts/classifiers' | ||
|
|
||
| const eoaClassifier = classifiers[AccountType.EOA] |
There was a problem hiding this comment.
I don't think it's necessary to keep a copy of this here
| it('should have the null code hash', async () => {}) | ||
| // Iterate through all of the EOAs and check that they have no code | ||
| // in the new node | ||
| it('should not have any code', async () => { |
There was a problem hiding this comment.
Checking every EOA is safer, but if it's too slow we could always just check a subset of every EOA for testnet + only check every EOA for mainnet.
| }) | ||
|
|
||
| it('should have the null storage root', async () => {}) | ||
| it.skip('should have the null code hash', async () => {}) |
There was a problem hiding this comment.
Should be accessibly by using eth_getProof
Description
Adds in initial test infra for the state surgery testing