Skip to content

Commit

Permalink
chore: Updated fork name from Merge -> Paris
Browse files Browse the repository at this point in the history
  • Loading branch information
MukulKolpe committed Dec 21, 2023
1 parent db5d933 commit 0b29fc9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/ethereum_test_forks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from .forks.transition import (
BerlinToLondonAt5,
MergeToShanghaiAtTime15k,
ParisToShanghaiAtTime15K,
ShanghaiToCancunAtTime15k,
)
from .helpers import (
Expand Down Expand Up @@ -53,7 +53,7 @@
"Istanbul",
"London",
"Paris",
"MergeToShanghaiAtTime15k",
"ParisToShanghaiAtTime15K",
"MuirGlacier",
"Shanghai",
"ShanghaiToCancunAtTime15k",
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class GrayGlacier(ArrowGlacier):

class Paris(London):
"""
Merge fork
Paris (Merge) fork
"""

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_forks/forks/transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BerlinToLondonAt5(Berlin):


@transition_fork(to_fork=Shanghai, at_timestamp=15_000)
class MergeToShanghaiAtTime15k(Paris):
class ParisToShanghaiAtTime15K(Paris):
"""
Merge to Shanghai transition at Timestamp 15k
"""
Expand Down
28 changes: 14 additions & 14 deletions src/ethereum_test_forks/tests/test_forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from ..base_fork import Fork
from ..forks.forks import Berlin, Cancun, Frontier, London, Paris, Shanghai
from ..forks.transition import BerlinToLondonAt5, MergeToShanghaiAtTime15k
from ..forks.transition import BerlinToLondonAt5, ParisToShanghaiAtTime15K
from ..helpers import (
forks_from,
forks_from_until,
Expand All @@ -31,7 +31,7 @@ def test_transition_forks():
"""
assert transition_fork_from_to(Berlin, London) == BerlinToLondonAt5
assert transition_fork_from_to(Berlin, Paris) is None
assert transition_fork_to(Shanghai) == [MergeToShanghaiAtTime15k]
assert transition_fork_to(Shanghai) == [ParisToShanghaiAtTime15K]

# Test forks transitioned to and from
assert BerlinToLondonAt5.transitions_to() == London
Expand All @@ -42,18 +42,18 @@ def test_transition_forks():
# Default values of transition forks is the transition block
assert BerlinToLondonAt5.fork() == "London"

assert MergeToShanghaiAtTime15k.fork(0, 14_999) == "Paris"
assert MergeToShanghaiAtTime15k.fork(0, 15_000) == "Shanghai"
assert MergeToShanghaiAtTime15k.fork() == "Shanghai"
assert ParisToShanghaiAtTime15K.fork(0, 14_999) == "Paris"
assert ParisToShanghaiAtTime15K.fork(0, 15_000) == "Shanghai"
assert ParisToShanghaiAtTime15K.fork() == "Shanghai"

assert BerlinToLondonAt5.header_base_fee_required(4, 0) is False
assert BerlinToLondonAt5.header_base_fee_required(5, 0) is True

assert MergeToShanghaiAtTime15k.header_withdrawals_required(0, 14_999) is False
assert MergeToShanghaiAtTime15k.header_withdrawals_required(0, 15_000) is True
assert ParisToShanghaiAtTime15K.header_withdrawals_required(0, 14_999) is False
assert ParisToShanghaiAtTime15K.header_withdrawals_required(0, 15_000) is True

assert MergeToShanghaiAtTime15k.engine_new_payload_version(0, 14_999) == 1
assert MergeToShanghaiAtTime15k.engine_new_payload_version(0, 15_000) == 2
assert ParisToShanghaiAtTime15K.engine_new_payload_version(0, 14_999) == 1
assert ParisToShanghaiAtTime15K.engine_new_payload_version(0, 15_000) == 2


def test_forks_from(): # noqa: D103
Expand All @@ -76,9 +76,9 @@ def test_forks():

# Test fork names
assert London.name() == "London"
assert MergeToShanghaiAtTime15k.name() == "MergeToShanghaiAtTime15k"
assert ParisToShanghaiAtTime15K.name() == "ParisToShanghaiAtTime15K"
assert f"{London}" == "London"
assert f"{MergeToShanghaiAtTime15k}" == "MergeToShanghaiAtTime15k"
assert f"{ParisToShanghaiAtTime15K}" == "ParisToShanghaiAtTime15K"

# Test some fork properties
assert Berlin.header_base_fee_required(0, 0) is False
Expand All @@ -90,9 +90,9 @@ def test_forks():
# Transition forks too
assert cast(Fork, BerlinToLondonAt5).header_base_fee_required(4, 0) is False
assert cast(Fork, BerlinToLondonAt5).header_base_fee_required(5, 0) is True
assert cast(Fork, MergeToShanghaiAtTime15k).header_withdrawals_required(0, 14_999) is False
assert cast(Fork, MergeToShanghaiAtTime15k).header_withdrawals_required(0, 15_000) is True
assert cast(Fork, MergeToShanghaiAtTime15k).header_withdrawals_required() is True
assert cast(Fork, ParisToShanghaiAtTime15K).header_withdrawals_required(0, 14_999) is False
assert cast(Fork, ParisToShanghaiAtTime15K).header_withdrawals_required(0, 15_000) is True
assert cast(Fork, ParisToShanghaiAtTime15K).header_withdrawals_required() is True

assert is_fork(Berlin, Berlin) is True
assert is_fork(London, Berlin) is True
Expand Down
1 change: 0 additions & 1 deletion src/ethereum_test_tools/code/yul.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def get_evm_version_from_fork(fork: Fork | None):
if not fork:
return None
fork_to_evm_version_map: Mapping[str, str] = {
"Merge": "paris",
"ConstantinopleFix": "constantinople",
}
if fork.name() in fork_to_evm_version_map:
Expand Down

0 comments on commit 0b29fc9

Please sign in to comment.