Skip to content

Commit

Permalink
After verification fill in class members
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Nov 19, 2018
1 parent 35a3aaf commit dae6918
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bitshares/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class Message(BlockchainInstance):
def __init__(self, message, *args, **kwargs):
BlockchainInstance.__init__(self, *args, **kwargs)
self.message = message
self.signed_by_account = None
self.signed_by_name = None

def sign(self, account=None, **kwargs):
""" Sign a message with an account's memo key
Expand Down Expand Up @@ -91,6 +93,9 @@ def sign(self, account=None, **kwargs):
wif
)).decode("ascii")

self.signed_by_account = account
self.signed_by_name = account["name"]

return SIGNED_MESSAGE_ENCAPSULATED.format(
MESSAGE_SPLIT=MESSAGE_SPLIT,
**locals()
Expand Down Expand Up @@ -170,4 +175,7 @@ def verify(self, **kwargs):
if format(pk, self.blockchain.prefix) != memo_key:
raise InvalidMessageSignature

self.signed_by_account = account
self.signed_by_name = account["name"]

return True

0 comments on commit dae6918

Please sign in to comment.