Skip to content

Commit

Permalink
core-utils: update geth genesis type
Browse files Browse the repository at this point in the history
Can specify the private key in the json file which
is nice for testing
  • Loading branch information
tynes committed Jun 2, 2022
1 parent 26a47f7 commit 17962ca
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-panthers-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/core-utils': patch
---

Update geth genesis type
52 changes: 34 additions & 18 deletions packages/core-utils/src/external/geth/geth-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,52 @@ export interface State {
[address: string]: {
nonce: number
balance: string
codeHash: string
root: string
codeHash?: string
root?: string
code?: string
storage?: {
[key: string]: string
}
secretKey?: string
}
}

/**
* Represents Geth's ChainConfig
*/
export interface ChainConfig {
chainId: number
homesteadBlock: number
eip150Block: number
eip155Block: number
eip158Block: number
byzantiumBlock: number
constantinopleBlock: number
petersburgBlock: number
istanbulBlock: number
muirGlacierBlock: number
berlinBlock: number
londonBlock?: number
arrowGlacierBlock?: number
mergeForkBlock?: number
terminalTotalDifficulty?: number
clique?: {
period: number
epoch: number
}
ethash?: {}
}

/**
* Represents Geth's genesis file format.
*/
export interface Genesis {
config: {
chainId: number
homesteadBlock: number
eip150Block: number
eip155Block: number
eip158Block: number
byzantiumBlock: number
constantinopleBlock: number
petersburgBlock: number
istanbulBlock: number
muirGlacierBlock: number
clique: {
period: number
epoch: number
}
}
config: ChainConfig
nonce?: number
timestamp?: number
difficulty: string
mixHash?: string
coinbase?: string
gasLimit: string
extraData: string
alloc: State
Expand Down

0 comments on commit 17962ca

Please sign in to comment.