Skip to content

Commit d7fca86

Browse files
committed
Use pprintpp for better object representation
1 parent 38414c1 commit d7fca86

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

poetry.lock

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pycardano/cip/cip8.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
from cose.messages import CoseMessage, Sign1Message
1111

1212
from pycardano.address import Address
13-
from pycardano.key import PaymentVerificationKey, SigningKey, StakeVerificationKey, VerificationKey
13+
from pycardano.key import (
14+
PaymentVerificationKey,
15+
SigningKey,
16+
StakeVerificationKey,
17+
VerificationKey,
18+
)
1419
from pycardano.network import Network
1520

1621

pycardano/serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
from datetime import datetime
1010
from decimal import Decimal
1111
from inspect import isclass
12-
from pprint import pformat
1312
from typing import Any, Callable, ClassVar, List, Type, TypeVar, Union, get_type_hints
1413

1514
from cbor2 import CBOREncoder, CBORSimpleValue, CBORTag, dumps, loads, undefined
15+
from pprintpp import pformat
1616
from typeguard import check_type, typechecked
1717

1818
from pycardano.exception import (
@@ -349,7 +349,7 @@ def from_cbor(cls, payload: Union[str, bytes]) -> CBORSerializable:
349349
return cls.from_primitive(value)
350350

351351
def __repr__(self):
352-
return pformat(vars(self))
352+
return pformat(vars(self), indent=2)
353353

354354

355355
def _restore_dataclass_field(

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ typeguard = "^2.13.3"
2828
blockfrost-python = "0.5.1"
2929
websocket-client = "^1.2.3"
3030
cose = "^0.9.dev8"
31+
pprintpp = "^0.4.0"
3132

3233
[tool.poetry.dev-dependencies]
3334
Sphinx = "^4.3.2"

test/pycardano/test_cip8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_verify_message_cose_key_attached():
5151
def test_verify_message_stake_address():
5252
signed_message = {
5353
"signature": "84582aa201276761646472657373581de0219f8e3ffefc82395df0bfcfe4e576f8f824bae0c731be35321c01d7a166686173686564f452507963617264616e6f20697320636f6f6c2e58402f2b75301a20876beba03ec68b30c5fbaebc99cb1d038b679340eb2299c2b75cd9c6c884c198e89f690548ee94a87168f5db34acf024d5788e58d119bcba630d",
54-
"key": "a40101032720062158200d8e03b5673bf8dabc567dd6150ebcd56179a91a6c0b245f477033dcab7dc780"
54+
"key": "a40101032720062158200d8e03b5673bf8dabc567dd6150ebcd56179a91a6c0b245f477033dcab7dc780",
5555
}
5656

5757
verification = verify(signed_message, attach_cose_key=True)

test/pycardano/test_txbuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def test_tx_builder_raises_utxo_selection(chain_context):
181181
tx_body = tx_builder.build(change_address=sender_address)
182182

183183
# The unfulfilled amount includes requested (991000000) and estimated fees (161277)
184-
assert "Unfulfilled amount:\n {'coin': 991161277" in e.value.args[0]
184+
assert "Unfulfilled amount:\n {\n 'coin': 991161277" in e.value.args[0]
185185
assert "{AssetName(b'NewToken'): 1}" in e.value.args[0]
186186

187187

0 commit comments

Comments
 (0)