Skip to content

Commit f5e4537

Browse files
authored
monorepo: clean up more test data (#4001)
* monorepo: clean up more test data * chore: linting * vm: fix example
1 parent 34b271e commit f5e4537

File tree

13 files changed

+131
-312
lines changed

13 files changed

+131
-312
lines changed

packages/block/examples/1559.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createBlock } from '@ethereumjs/block'
2-
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
2+
import { Common, Mainnet } from '@ethereumjs/common'
33
import { createTx } from '@ethereumjs/tx'
44
const common = new Common({ chain: Mainnet })
55

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Common, Mainnet, createCustomCommon } from '@ethereumjs/common'
2-
3-
import myCustomChain1 from './genesisData/testnet.json'
1+
import { Mainnet, createCustomCommon } from '@ethereumjs/common'
2+
import { customChainConfig } from '@ethereumjs/testdata'
43

54
// Add custom chain config
6-
const common1 = createCustomCommon(myCustomChain1, Mainnet)
5+
const common1 = createCustomCommon(customChainConfig, Mainnet)
76
console.log(`Common is instantiated with custom chain parameters - ${common1.chainName()}`)

packages/common/examples/fromGeth.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { createCommonFromGethGenesis } from '@ethereumjs/common'
2+
import { postMergeGethGenesis } from '@ethereumjs/testdata'
23
import { hexToBytes } from '@ethereumjs/util'
34

4-
import genesisJSON from './genesisData/post-merge.json'
5-
65
const genesisHash = hexToBytes('0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a')
76
// Load geth genesis JSON file into lets say `genesisJSON` and optional `chain` and `genesisHash`
8-
const common = createCommonFromGethGenesis(genesisJSON, { chain: 'customChain', genesisHash })
7+
const common = createCommonFromGethGenesis(postMergeGethGenesis, {
8+
chain: 'customChain',
9+
genesisHash,
10+
})
911
// If you don't have `genesisHash` while initiating common, you can later configure common (for e.g.
1012
// after calculating it via `blockchain`)
1113
common.setForkHashes(genesisHash)

packages/common/examples/genesisData/post-merge.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

packages/common/examples/genesisData/testnet.json

Lines changed: 0 additions & 59 deletions
This file was deleted.

packages/common/examples/genesisData/testnet2.json

Lines changed: 0 additions & 59 deletions
This file was deleted.

packages/vm/examples/helpers/blockchain-mock-data.json

Lines changed: 0 additions & 93 deletions
This file was deleted.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
export const blockchainMockData = {
2+
_info: {
3+
comment: '',
4+
filledwith: 'cpp-1.3.0+commit.70e7d177.Linux.g++',
5+
source: '../../tests/src/BlockchainTestsFiller/bcValidBlockTest/SimpleTxFiller.json',
6+
},
7+
blocks: [
8+
{
9+
blockHeader: {
10+
bloom:
11+
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
12+
coinbase: '0x8888f1f195afa192cfee860698584c030f4c9db1',
13+
difficulty: '0x020000',
14+
extraData: '',
15+
gasLimit: '0x2fefd8',
16+
gasUsed: '0x5208',
17+
hash: '0x117545e24e3d1e1836bb92e3d6f3e77ac5b2ecd171a535830bf9b5afb8f522e5',
18+
mixHash: '0x0a55dc80ced5e71738a5a15e12f63be192a65c5cb257f8ee10c875c9599b5b52',
19+
nonce: '0xba58e9414abfa06f',
20+
number: '0x01',
21+
parentHash: '0x7285abd5b24742f184ad676e31f6054663b3529bc35ea2fcad8a3e0f642a46f7',
22+
receiptTrie: '0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2',
23+
stateRoot: '0xecc60e00b3fe5ce9f6e1a10e5469764daf51f1fe93c22ec3f9a7583a80357217',
24+
timestamp: '0x59af0178',
25+
transactionsTrie: '0x53d5b71a8fbb9590de82d69dfa4ac31923b0c8afce0d30d0d8d1e931f25030dc',
26+
uncleHash: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
27+
},
28+
rlp: '0xf90260f901f9a07285abd5b24742f184ad676e31f6054663b3529bc35ea2fcad8a3e0f642a46f7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0ecc60e00b3fe5ce9f6e1a10e5469764daf51f1fe93c22ec3f9a7583a80357217a053d5b71a8fbb9590de82d69dfa4ac31923b0c8afce0d30d0d8d1e931f25030dca0056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd88252088459af017880a00a55dc80ced5e71738a5a15e12f63be192a65c5cb257f8ee10c875c9599b5b5288ba58e9414abfa06ff861f85f800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba0f3266921c93d600c43f6fa4724b7abae079b35b9e95df592f95f9f3445e94c88a012f977552ebdb7a492cf35f3106df16ccb4576ebad4113056ee1f52cbe4978c1c0',
29+
transactions: [
30+
{
31+
data: '',
32+
gasLimit: '0xc350',
33+
gasPrice: '0x0a',
34+
nonce: '0x00',
35+
r: '0xf3266921c93d600c43f6fa4724b7abae079b35b9e95df592f95f9f3445e94c88',
36+
s: '0x12f977552ebdb7a492cf35f3106df16ccb4576ebad4113056ee1f52cbe4978c1',
37+
to: '0x095e7baea6a6c7c4c2dfeb977efac326af552d87',
38+
v: '0x1b',
39+
value: '0x0a',
40+
},
41+
],
42+
uncleHeaders: [],
43+
},
44+
],
45+
genesisBlockHeader: {
46+
bloom:
47+
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
48+
coinbase: '0x8888f1f195afa192cfee860698584c030f4c9db1',
49+
difficulty: '0x020000',
50+
extraData: '0x42',
51+
gasLimit: '0x2fefd8',
52+
gasUsed: '0x00',
53+
hash: '0x7285abd5b24742f184ad676e31f6054663b3529bc35ea2fcad8a3e0f642a46f7',
54+
mixHash: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
55+
nonce: '0x0102030405060708',
56+
number: '0x00',
57+
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
58+
receiptTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
59+
stateRoot: '0xcafd881ab193703b83816c49ff6c2bf6ba6f464a1be560c42106128c8dbc35e7',
60+
timestamp: '0x54c98c81',
61+
transactionsTrie: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
62+
uncleHash: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
63+
},
64+
genesisRLP:
65+
'0xf901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0cafd881ab193703b83816c49ff6c2bf6ba6f464a1be560c42106128c8dbc35e7a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421880102030405060708c0c0',
66+
lastblockhash: '0x117545e24e3d1e1836bb92e3d6f3e77ac5b2ecd171a535830bf9b5afb8f522e5',
67+
network: 'Byzantium',
68+
postState: {
69+
'0x095e7baea6a6c7c4c2dfeb977efac326af552d87': {
70+
balance: '0x0a',
71+
code: '',
72+
nonce: '0x00',
73+
storage: {},
74+
},
75+
'0x8888f1f195afa192cfee860698584c030f4c9db1': {
76+
balance: '0x29a2241af62f3450',
77+
code: '',
78+
nonce: '0x00',
79+
storage: {},
80+
},
81+
'0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b': {
82+
balance: '0x025408afa6',
83+
code: '',
84+
nonce: '0x01',
85+
storage: {},
86+
},
87+
},
88+
pre: {
89+
'0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b': {
90+
balance: '0x02540be400',
91+
code: '',
92+
nonce: '0x00',
93+
storage: {},
94+
},
95+
},
96+
}

0 commit comments

Comments
 (0)