Skip to content

Commit c810d2a

Browse files
committed
common -> custom chains: replaced test example files
1 parent e36979b commit c810d2a

File tree

5 files changed

+124
-164
lines changed

5 files changed

+124
-164
lines changed

packages/common/tests/customChains.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import tape from 'tape'
22
import Common from '../src/'
33
import testnet from './data/testnet.json'
4-
import energyWebChain from './data/energyWebChain.json'
5-
import volta from './data/volta.json'
4+
import testnet2 from './data/testnet2.json'
5+
import testnet3 from './data/testnet3.json'
66

77
tape('[Common]: Custom chains', function (t: tape.Test) {
88
t.test(
@@ -88,10 +88,10 @@ tape('[Common]: Custom chains', function (t: tape.Test) {
8888
st.equal(c.chainName(), 'testnet', 'customChains, chain initialized with custom chain')
8989
st.equal(c.hardforkBlock(), 4, 'customChains, chain initialized with custom chain')
9090

91-
const customChains = [testnet, energyWebChain, volta]
92-
c = new Common({ chain: 'energyWebChain', hardfork: 'istanbul', customChains })
93-
st.equal(c.chainName(), 'energyWebChain', 'customChains, chain initialized with custom chain')
94-
st.equal(c.hardforkBlock(), 4922294, 'customChains, chain initialized with custom chain')
91+
const customChains = [testnet, testnet2, testnet3]
92+
c = new Common({ chain: 'testnet2', hardfork: 'istanbul', customChains })
93+
st.equal(c.chainName(), 'testnet2', 'customChains, chain initialized with custom chain')
94+
st.equal(c.hardforkBlock(), 10, 'customChains, chain initialized with custom chain')
9595

9696
st.end()
9797
})

packages/common/tests/data/energyWebChain.json

Lines changed: 0 additions & 79 deletions
This file was deleted.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "testnet2",
3+
"chainId": 22222,
4+
"networkId": 22222,
5+
"defaultHardfork": "istanbul",
6+
"consensus": {
7+
"type": "pos",
8+
"algorithm": "clique"
9+
},
10+
"comment": "Private test network",
11+
"url": "[TESTNET_URL]",
12+
"genesis": {
13+
"hash": "0xaa00000000000000000000000000000000000000000000000000000000000000",
14+
"timestamp": null,
15+
"gasLimit": 1000000,
16+
"difficulty": 1,
17+
"nonce": "0xbb00000000000000",
18+
"extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
19+
"stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000"
20+
},
21+
"hardforks": [
22+
{
23+
"name": "chainstart",
24+
"block": 0
25+
},
26+
{
27+
"name": "homestead",
28+
"block": 1
29+
},
30+
{
31+
"name": "tangerineWhistle",
32+
"block": 2
33+
},
34+
{
35+
"name": "spuriousDragon",
36+
"block": 3
37+
},
38+
{
39+
"name": "istanbul",
40+
"block": 10
41+
}
42+
],
43+
"bootstrapNodes": [
44+
{
45+
"ip": "10.0.0.1",
46+
"port": 30303,
47+
"id": "11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
48+
"location": "",
49+
"comment": ""
50+
},
51+
{
52+
"ip": "10.0.0.2",
53+
"port": 30303,
54+
"id": "22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
55+
"location": "",
56+
"comment": ""
57+
}
58+
]
59+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "testnet3",
3+
"chainId": 33333,
4+
"networkId": 33333,
5+
"defaultHardfork": "istanbul",
6+
"consensus": {
7+
"type": "pos",
8+
"algorithm": "clique"
9+
},
10+
"comment": "Private test network",
11+
"url": "[TESTNET_URL]",
12+
"genesis": {
13+
"hash": "0xaa00000000000000000000000000000000000000000000000000000000000000",
14+
"timestamp": null,
15+
"gasLimit": 1000000,
16+
"difficulty": 1,
17+
"nonce": "0xbb00000000000000",
18+
"extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
19+
"stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000"
20+
},
21+
"hardforks": [
22+
{
23+
"name": "chainstart",
24+
"block": 0
25+
},
26+
{
27+
"name": "homestead",
28+
"block": 1
29+
},
30+
{
31+
"name": "tangerineWhistle",
32+
"block": 2
33+
},
34+
{
35+
"name": "spuriousDragon",
36+
"block": 3
37+
},
38+
{
39+
"name": "istanbul",
40+
"block": 10
41+
}
42+
],
43+
"bootstrapNodes": [
44+
{
45+
"ip": "10.0.0.1",
46+
"port": 30303,
47+
"id": "11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
48+
"location": "",
49+
"comment": ""
50+
},
51+
{
52+
"ip": "10.0.0.2",
53+
"port": 30303,
54+
"id": "22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
55+
"location": "",
56+
"comment": ""
57+
}
58+
]
59+
}

packages/common/tests/data/volta.json

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

0 commit comments

Comments
 (0)