moved dbcreator to onionrsetup
parent
2a6782f88d
commit
e4df34ef29
|
@ -22,7 +22,7 @@ import sqlite3, os
|
||||||
from onionrplugins import onionrevents as events
|
from onionrplugins import onionrevents as events
|
||||||
from onionrutils import localcommand, epoch
|
from onionrutils import localcommand, epoch
|
||||||
from .. import dbfiles
|
from .. import dbfiles
|
||||||
import dbcreator
|
from onionrsetup import dbcreator
|
||||||
|
|
||||||
def daemon_queue()->str:
|
def daemon_queue()->str:
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
import sys, sqlite3, os
|
import sys, sqlite3, os
|
||||||
from onionrutils import bytesconverter, stringvalidators
|
from onionrutils import bytesconverter, stringvalidators
|
||||||
from coredb import dbfiles
|
from coredb import dbfiles
|
||||||
import filepaths, onionrcrypto, dbcreator, onionrexceptions
|
import filepaths, onionrcrypto, onionrexceptions
|
||||||
|
from onionrsetup import dbcreator
|
||||||
from onionrcrypto import hashers
|
from onionrcrypto import hashers
|
||||||
from . import setdata
|
from . import setdata
|
||||||
DB_ENTRY_SIZE_LIMIT = 10000 # Will be a config option
|
DB_ENTRY_SIZE_LIMIT = 10000 # Will be a config option
|
||||||
|
|
|
@ -35,8 +35,8 @@ def get_human_readable_ID(pub=''):
|
||||||
if not len(pub) == onionrvalues.MAIN_PUBLIC_KEY_SIZE:
|
if not len(pub) == onionrvalues.MAIN_PUBLIC_KEY_SIZE:
|
||||||
pub = base64.b32decode(pub)
|
pub = base64.b32decode(pub)
|
||||||
|
|
||||||
return m.to_mnemonic(pub)
|
return m.to_mnemonic(pub).replace(' ', '-')
|
||||||
|
|
||||||
def get_base32(words):
|
def get_base32(words):
|
||||||
'''converts mnemonic to base32'''
|
'''converts mnemonic to base32'''
|
||||||
return unpaddedbase32.b32encode(m.to_entropy(words))
|
return unpaddedbase32.b32encode(m.to_entropy(words.replace('-', ' ')))
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
'''
|
'''
|
||||||
import os
|
import os
|
||||||
from . import identifyhome
|
from . import identifyhome
|
||||||
import dbcreator, filepaths
|
from onionrsetup import dbcreator
|
||||||
|
import filepaths
|
||||||
home = identifyhome.identify_home()
|
home = identifyhome.identify_home()
|
||||||
|
|
||||||
def create_dirs():
|
def create_dirs():
|
||||||
|
|
|
@ -51,7 +51,7 @@ class OnionrCryptoTests(unittest.TestCase):
|
||||||
|
|
||||||
def test_human_readable_length(self):
|
def test_human_readable_length(self):
|
||||||
human = mnemonickeys.get_human_readable_ID()
|
human = mnemonickeys.get_human_readable_ID()
|
||||||
self.assertTrue(len(human.split(' ')) == 24)
|
self.assertTrue(len(human.split('-')) == 24)
|
||||||
|
|
||||||
def test_safe_compare(self):
|
def test_safe_compare(self):
|
||||||
self.assertTrue(crypto.cryptoutils.safe_compare('test', 'test'))
|
self.assertTrue(crypto.cryptoutils.safe_compare('test', 'test'))
|
||||||
|
|
Loading…
Reference in New Issue