Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Deck::to_json() include p2th_wif
Browse files Browse the repository at this point in the history
  • Loading branch information
peerchemist committed Aug 3, 2018
1 parent 88514e1 commit 98aa376
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pypeerassets/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion test/test_peerassets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}


Expand Down
3 changes: 2 additions & 1 deletion test/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down

0 comments on commit 98aa376

Please sign in to comment.