Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 823c145

Browse files
committed
lint/mypy: silence more messages on "improper" f-string formatting.
Copy-paste from the earlier commit (that was cherry-picked from previous PR): The messages silenced in this commit are all: On Python 3 '{}'.format(b'abc') produces "b'abc'"; use !r if this is a desired behavior Sadly, `mypy` doesn't say which particular fields are problematic; I've tried my best to single them out - hopefully, nothing extraneous got in.
1 parent 606c64f commit 823c145

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

eth/db/chain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,16 @@ def persist_unexecuted_block(self,
141141

142142
if tx_root_hash != block.header.transaction_root:
143143
raise ValidationError(
144-
f"Block's transaction_root ({block.header.transaction_root}) "
145-
f"does not match expected value: {tx_root_hash}"
144+
f"Block's transaction_root ({block.header.transaction_root!r}) "
145+
f"does not match expected value: {tx_root_hash!r}"
146146
)
147147

148148
receipt_root_hash, receipt_kv_nodes = make_trie_root_and_nodes(receipts)
149149

150150
if receipt_root_hash != block.header.receipt_root:
151151
raise ValidationError(
152-
f"Block's receipt_root ({block.header.receipt_root}) "
153-
f"does not match expected value: {receipt_root_hash}"
152+
f"Block's receipt_root ({block.header.receipt_root!r}) "
153+
f"does not match expected value: {receipt_root_hash!r}"
154154
)
155155

156156
with self.db.atomic_batch() as db:

eth/db/header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _persist_checkpoint_header(
261261
# True parent should have already been canonicalized during
262262
# _set_as_canonical_chain_head()
263263
raise ValidationError(
264-
f"Why was a non-matching parent header {parent_hash} left as canonical "
264+
f"Why was a non-matching parent header {parent_hash!r} left as canonical "
265265
f"after _set_as_canonical_chain_head() and {true_parent} is available?"
266266
)
267267

0 commit comments

Comments
 (0)