Skip to content

Commit

Permalink
Change eth-tester coinbase key back to miner
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Dec 16, 2022
1 parent febd4ef commit d27d674
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 0 additions & 10 deletions tests/integration/test_ethereum_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,6 @@ def test_eth_send_transaction_no_gas(self, eth_tester, w3, unlocked_account):
def test_eth_send_transaction_no_max_fee(self, eth_tester, w3, unlocked_account):
super().test_eth_send_transaction_no_max_fee(w3, unlocked_account)

def test_eth_get_balance_with_block_identifier(self, w3: "Web3") -> None:
# in eth-tester we've changed 'mining' nomenclature to 'coinbase'
coinbase_address = w3.eth.get_block(1)["coinbase"]
genesis_balance = w3.eth.get_balance(coinbase_address, 0)
later_balance = w3.eth.get_balance(coinbase_address, 1)

assert is_integer(genesis_balance)
assert is_integer(later_balance)
assert later_balance > genesis_balance

def test_eth_getBlockByNumber_safe(
self, w3: "Web3", empty_block: BlockData
) -> None:
Expand Down
4 changes: 4 additions & 0 deletions web3/providers/eth_tester/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ def is_hexstr(value: Any) -> bool:
"extra_data": "extraData",
"gas_used": "gasUsed",
"base_fee_per_gas": "baseFeePerGas",
# eth-tester changed the miner key to coinbase since
# there is no longer any mining happening, but the current
# JSON-RPC spec still says miner
"coinbase": "miner",
}
block_result_remapper = apply_key_map(BLOCK_RESULT_KEY_MAPPING)

Expand Down

0 comments on commit d27d674

Please sign in to comment.