Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Update block __repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed May 2, 2019
1 parent 8b98b95 commit db60596
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions eth2/beacon/types/block_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def __init__(self,
)

def __repr__(self) -> str:
return '<BlockHeader #{0} {1}>'.format(
self.slot,
encode_hex(self.signing_root)[2:10],
)
return (
f'<Block #{self.slot} '
f'signing_root={encode_hex(self.signing_root)[2:10]} '
f'root={encode_hex(self.root)[2:10]}>'
)
7 changes: 4 additions & 3 deletions eth2/beacon/types/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ def __init__(self,
)

def __repr__(self) -> str:
return '<Block #{0} {1}>'.format(
self.slot,
encode_hex(self.signing_root)[2:10],
return (
f'<Block #{self.slot} '
f'signing_root={encode_hex(self.signing_root)[2:10]} '
f'root={encode_hex(self.root)[2:10]}>'
)

@property
Expand Down

0 comments on commit db60596

Please sign in to comment.