Skip to content

Commit 514417a

Browse files
committed
Remove chain.set_coinbase & .set_extra_data: YAGNI
It was untested, and had a bug of not reusing the values on the next header. Move to another PR, and add tests. But probably not until someone actually starts using it.
1 parent 44bb159 commit 514417a

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

eth/abc.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4073,20 +4073,6 @@ def set_header_timestamp(self, timestamp: int) -> None:
40734073
"""
40744074
...
40754075

4076-
@abstractmethod
4077-
def set_coinbase(self, coinbase: Address) -> None:
4078-
"""
4079-
Set the coinbase for all new headers.
4080-
"""
4081-
...
4082-
4083-
@abstractmethod
4084-
def set_extra_data(self, extra_data: bytes) -> None:
4085-
"""
4086-
Set the extra_data (sometimes called graffiti) for all new headers.
4087-
"""
4088-
...
4089-
40904076
@abstractmethod
40914077
def mine_all(
40924078
self,

eth/chains/base.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@
5757
)
5858
from eth.constants import (
5959
EMPTY_UNCLE_HASH,
60-
GENESIS_EXTRA_DATA,
6160
MAX_UNCLE_DEPTH,
62-
ZERO_ADDRESS,
6361
)
6462

6563
from eth.db.chain import (
@@ -628,8 +626,6 @@ class MiningChain(Chain, MiningChainAPI):
628626

629627
def __init__(self, base_db: AtomicDatabaseAPI, header: BlockHeaderAPI = None) -> None:
630628
super().__init__(base_db)
631-
self._header_extra_data = GENESIS_EXTRA_DATA
632-
self._header_coinbase = ZERO_ADDRESS
633629
self.header = self.ensure_header(header)
634630

635631
def apply_transaction(self,
@@ -667,14 +663,6 @@ def import_block(self,
667663
def set_header_timestamp(self, timestamp: int) -> None:
668664
self.header = self.header.copy(timestamp=timestamp)
669665

670-
def set_coinbase(self, coinbase: Address) -> None:
671-
self.header = self.header.copy(coinbase=coinbase)
672-
self._header_coinbase = coinbase
673-
674-
def set_extra_data(self, extra_data: bytes) -> None:
675-
self.header = self.header.copy(extra_data=extra_data)
676-
self._header_extra_data = extra_data
677-
678666
def mine_all(
679667
self,
680668
transactions: Sequence[SignedTransactionAPI],

0 commit comments

Comments
 (0)