fixed vanity not working and added integration test for it

This commit is contained in:
Kevin Froman 2020-02-22 05:44:21 -06:00
parent 6b5e6a9ad0
commit 34a55f63f9
5 changed files with 49 additions and 3 deletions

View file

@ -55,6 +55,8 @@ def block_exec(event, info):
'multiprocessing/popen_fork.py',
'multiprocessing/util.py',
'multiprocessing/connection.py',
'multiprocessing/queues.py',
'multiprocessing/synchronize.py',
'onionrutils/escapeansi.py',
'stem/connection.py',
'stem/response/add_onion.py',
@ -64,9 +66,12 @@ def block_exec(event, info):
'stem/response/mapaddress.py',
'stem/response/protocolinfo.py'
]
whitelisted_source = []
home = identifyhome.identify_home()
code_b64 = base64.b64encode(info[0].co_code).decode()
if code_b64 in whitelisted_source:
return
for source in whitelisted_code:
if info[0].co_filename.endswith(source):

View file

@ -43,7 +43,7 @@ def notify(title: str = "Onionr", message: str = ""):
simplenotify.notify(title, message)
def notification_with_sound(sound = '', **kwargs):
def notification_with_sound(sound='', **kwargs):
if not notifications_enabled:
return
if not sound:

View file

@ -148,7 +148,7 @@ def add_vanity():
else:
b32_pub = unpaddedbase32.b32encode(vanity[0])
tell('Found vanity address:\n' +
niceware.bytes_to_passphrase(vanity[0]))
'-'.join(niceware.bytes_to_passphrase(vanity[0])))
tell('Base32 Public key: %s' % (b32_pub.decode(),))
key_manager.addKey(b32_pub, unpaddedbase32.b32encode(vanity[1]))
except KeyboardInterrupt: