moved dbcreator to onionrsetup

This commit is contained in:
Kevin Froman 2019-09-23 14:48:35 -05:00
parent 2a6782f88d
commit e4df34ef29
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
7 changed files with 9 additions and 7 deletions

View File

@ -22,7 +22,7 @@ import sqlite3, os
from onionrplugins import onionrevents as events
from onionrutils import localcommand, epoch
from .. import dbfiles
import dbcreator
from onionrsetup import dbcreator
def daemon_queue()->str:
'''

View File

@ -20,7 +20,8 @@
import sys, sqlite3, os
from onionrutils import bytesconverter, stringvalidators
from coredb import dbfiles
import filepaths, onionrcrypto, dbcreator, onionrexceptions
import filepaths, onionrcrypto, onionrexceptions
from onionrsetup import dbcreator
from onionrcrypto import hashers
from . import setdata
DB_ENTRY_SIZE_LIMIT = 10000 # Will be a config option

View File

@ -35,8 +35,8 @@ def get_human_readable_ID(pub=''):
if not len(pub) == onionrvalues.MAIN_PUBLIC_KEY_SIZE:
pub = base64.b32decode(pub)
return m.to_mnemonic(pub)
return m.to_mnemonic(pub).replace(' ', '-')
def get_base32(words):
'''converts mnemonic to base32'''
return unpaddedbase32.b32encode(m.to_entropy(words))
return unpaddedbase32.b32encode(m.to_entropy(words.replace('-', ' ')))

View File

@ -19,7 +19,8 @@
'''
import os
from . import identifyhome
import dbcreator, filepaths
from onionrsetup import dbcreator
import filepaths
home = identifyhome.identify_home()
def create_dirs():

View File

@ -51,7 +51,7 @@ class OnionrCryptoTests(unittest.TestCase):
def test_human_readable_length(self):
human = mnemonickeys.get_human_readable_ID()
self.assertTrue(len(human.split(' ')) == 24)
self.assertTrue(len(human.split('-')) == 24)
def test_safe_compare(self):
self.assertTrue(crypto.cryptoutils.safe_compare('test', 'test'))