Skip to content

Commit

Permalink
Genesis cleanup (ethereumjs#2815)
Browse files Browse the repository at this point in the history
* Cleanup genesis imports/types

* ts config cleanup
  • Loading branch information
acolytec3 authored Jun 23, 2023
1 parent e0282e3 commit 91f7c9d
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 58 deletions.
24 changes: 20 additions & 4 deletions packages/genesis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./mainnet": {
"import": "./dist/esm/genesisStates/mainnet.js",
"require": "./dist/cjs/genesisStates/mainnet.js"
},
"./goerli": {
"import": "./dist/esm/genesisStates/goerli.js",
"require": "./dist/cjs/genesisStates/goerli.js"
},
"./ropsten": {
"import": "./dist/esm/genesisStates/ropsten.js",
"require": "./dist/cjs/genesisStates/ropsten.js"
},
"./rinkeby": {
"import": "./dist/esm/genesisStates/rinkeby.js",
"require": "./dist/cjs/genesisStates/rinkeby.js"
},
"./sepolia": {
"import": "./dist/esm/genesisStates/sepolia.js",
"require": "./dist/cjs/genesisStates/sepolia.js"
}
},
"files": [
Expand All @@ -47,10 +67,6 @@
"@ethereumjs/common": "^3.1.2",
"@ethereumjs/util": "^8.0.6"
},
"devDependencies": {
"@types/async": "^2.4.1",
"@types/level-errors": "^3.0.0"
},
"engines": {
"node": ">=16"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/genesis/src/genesisStates/goerli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const goerliGenesis = {
import { GenesisState } from '@ethereumjs/util'

export const goerliGenesis: GenesisState = {
'0x0000000000000000000000000000000000000000': '0x1',
'0x0000000000000000000000000000000000000001': '0x1',
'0x0000000000000000000000000000000000000002': '0x1',
Expand Down
4 changes: 3 additions & 1 deletion packages/genesis/src/genesisStates/mainnet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const mainnetGenesis = {
import { GenesisState } from '@ethereumjs/util'

export const mainnetGenesis: GenesisState = {
'0x000d836201318ec6899a67540690382780743280': '0xad78ebc5ac6200000',
'0x001762430ea9c3a26e5749afdb70da5f78ddbb8c': '0xad78ebc5ac6200000',
'0x001d14804b399c6ef80e64576f657660804fec0b': '0xe3aeb5737240a00000',
Expand Down
4 changes: 3 additions & 1 deletion packages/genesis/src/genesisStates/rinkeby.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const rinkebyGenesis = {
import { GenesisState } from '@ethereumjs/util'

export const rinkebyGenesis: GenesisState = {
'0x0000000000000000000000000000000000000000': '0x1',
'0x0000000000000000000000000000000000000001': '0x1',
'0x0000000000000000000000000000000000000002': '0x1',
Expand Down
4 changes: 3 additions & 1 deletion packages/genesis/src/genesisStates/ropsten.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const ropstenGenesis = {
import { GenesisState } from '@ethereumjs/util'

export const ropstenGenesis: GenesisState = {
'0x0000000000000000000000000000000000000000': '0x1',
'0x0000000000000000000000000000000000000001': '0x1',
'0x0000000000000000000000000000000000000002': '0x1',
Expand Down
4 changes: 3 additions & 1 deletion packages/genesis/src/genesisStates/sepolia.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const sepoliaGenesis = {
import { GenesisState } from '@ethereumjs/util'

export const sepoliaGenesis: GenesisState = {
'0xa2A6d93439144FFE4D27c9E088dCD8b783946263': '0xD3C21BCECCEDA1000000',
'0xBc11295936Aa79d594139de1B2e12629414F3BDB': '0xD3C21BCECCEDA1000000',
'0x7cF5b79bfe291A67AB02b393E456cCc4c266F753': '0xD3C21BCECCEDA1000000',
Expand Down
38 changes: 0 additions & 38 deletions packages/genesis/src/types.ts

This file was deleted.

6 changes: 1 addition & 5 deletions packages/genesis/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../config/tsconfig.json",
"include": ["src/**/*.ts", "test/**/*.ts"],
"compilerOptions": {
"types": ["node"],
"typeRoots": ["node_modules/@types"]
}
"include": ["src/**/*.ts", "test/**/*.ts"]
}
2 changes: 0 additions & 2 deletions packages/genesis/tsconfig.prod.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "dist/cjs",
"types": ["node"],
"typeRoots": ["node_modules/@types"],
"composite": true
},
"include": ["src/**/*.ts", "src/**/*.json"],
Expand Down
2 changes: 0 additions & 2 deletions packages/genesis/tsconfig.prod.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "dist/esm",
"types": ["node"],
"typeRoots": ["node_modules/@types"],
"composite": true
},
"include": ["src/**/*.ts", "src/**/*.json"],
Expand Down
2 changes: 1 addition & 1 deletion packages/genesis/typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ module.exports = {
extends: '../../config/typedoc.js',
entryPoints: ['src'],
out: 'docs',
exclude: ['test/**/*.ts', 'src/db/**', 'src/clique.ts'],
exclude: ['test/**/*.ts'],
}
2 changes: 1 addition & 1 deletion packages/trie/test/util/genesisState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('[Util/genesisStateRoot]', () => {
})

it('should correctly derive ropsten stateRoot from ethereumjs genesis', async () => {
const stateRoot = await genesisStateRoot(getGenesis(3)!)
const stateRoot = await genesisStateRoot(getGenesis(3))
assert.equal(
bytesToHex(stateRoot),
'217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b',
Expand Down

0 comments on commit 91f7c9d

Please sign in to comment.