diff --git a/pypeerassets/protocol.py b/pypeerassets/protocol.py index 0185c50..df3c7c2 100644 --- a/pypeerassets/protocol.py +++ b/pypeerassets/protocol.py @@ -143,7 +143,9 @@ def metainfo_to_dict(self) -> dict: def to_json(self) -> dict: '''export the Deck object to json-ready format''' - return self.__dict__ + d = self.__dict__ + d['p2th_wif'] = self.p2th_wif + return d @classmethod def from_json(cls, json: dict): diff --git a/test/test_peerassets.py b/test/test_peerassets.py index 79c3bab..c5d57d1 100644 --- a/test/test_peerassets.py +++ b/test/test_peerassets.py @@ -25,7 +25,8 @@ def test_find_deck(prov): 'number_of_decimals': 2, 'production': True, 'version': 1, - 'tx_confirmations': 100 + 'tx_confirmations': 100, + 'p2th_wif': 'cThmj6Qu6aTUeA5f4FoNJTsBA8K6ZjhXbZkwsqcmv94xjWiCBr5d' } diff --git a/test/test_protocol.py b/test/test_protocol.py index 7e3c460..7083edf 100644 --- a/test/test_protocol.py +++ b/test/test_protocol.py @@ -30,7 +30,8 @@ def test_deck_object(): 'network': 'ppc', 'number_of_decimals': 2, 'production': True, - 'version': 1 + 'version': 1, + 'p2th_wif': None } assert deck.metainfo_to_protobuf == b'\x08\x01\x12\x05decky\x18\x02 \x04*\rJust testing.'