Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Activating Istanbul (#68)
Browse files Browse the repository at this point in the history
* Set block number for Istanbul

* Adapt tests for Istanbul

* Update Istanbul description

* Docs: adding Istanbul to the supported fork list
  • Loading branch information
evertonfraga authored and s1na committed Nov 5, 2019
1 parent d321b6e commit 71bd671
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ library supported:
- `byzantium`
- `constantinople`
- `petersburg` (aka `constantinopleFix`, apply together with `constantinople`)
- `istanbul`

## Future Hardforks

Expand Down
2 changes: 1 addition & 1 deletion src/chains/goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
{
"name": "istanbul",
"block": null,
"block": 1561651,
"consensus": "poa",
"finality": null
}
Expand Down
2 changes: 1 addition & 1 deletion src/chains/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
{
"name": "istanbul",
"block": null,
"block": 9069000,
"consensus": "pow",
"finality": null
}
Expand Down
2 changes: 1 addition & 1 deletion src/chains/rinkeby.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
{
"name": "istanbul",
"block": null,
"block": 5435345,
"consensus": "poa",
"finality": null
}
Expand Down
2 changes: 1 addition & 1 deletion src/chains/ropsten.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
{
"name": "istanbul",
"block": null,
"block": 6485846,
"consensus": "pow",
"finality": null
}
Expand Down
2 changes: 1 addition & 1 deletion src/hardforks/istanbul.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "istanbul",
"comment": "HF targeted for October 2019 following the Constantinople/Petersburg HF",
"comment": "HF targeted for December 2019 following the Constantinople/Petersburg HF",
"eip": {
"url": "https://eips.ethereum.org/EIPS/eip-1679",
"status": "Draft"
Expand Down
12 changes: 8 additions & 4 deletions tests/hardforks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ tape('[Common]: Hardfork logic', function(t: tape.Test) {
msg = 'should return the correct HF change block for byzantium (set)'
st.equal(c.hardforkBlock(), 1700000, msg)

c = new Common('ropsten', 'istanbul')
msg = 'should return the correct HF change block for istanbul (set)'
st.equal(c.hardforkBlock(), 6485846, msg)

st.end()
})

Expand All @@ -56,8 +60,8 @@ tape('[Common]: Hardfork logic', function(t: tape.Test) {

t.test('activeHardforks()', function(st: tape.Test) {
let c = new Common('ropsten')
let msg = 'should return 7 active hardforks for Ropsten'
st.equal(c.activeHardforks().length, 7, msg)
let msg = 'should return 8 active hardforks for Ropsten'
st.equal(c.activeHardforks().length, 8, msg)

msg = 'should return the correct HF data for Ropsten'
st.equal(c.activeHardforks()[3]['name'], 'spuriousDragon', msg)
Expand All @@ -81,8 +85,8 @@ tape('[Common]: Hardfork logic', function(t: tape.Test) {

t.test('activeHardfork()', function(st: tape.Test) {
let c = new Common('ropsten')
let msg = 'should return petersburg as latest active HF for Ropsten'
st.equal(c.activeHardfork(), 'petersburg', msg)
let msg = 'should return istanbul as latest active HF for Ropsten'
st.equal(c.activeHardfork(), 'istanbul', msg)

msg = 'should return spuriousDragon as latest active HF for Ropsten for block 10'
st.equal(c.activeHardfork(10), 'spuriousDragon', msg)
Expand Down

0 comments on commit 71bd671

Please sign in to comment.