moved dbcreator to onionrsetup

master
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

@ -92,4 +92,4 @@ class PrivateAPI:
pass pass
def getBlockData(self, bHash, decrypt=False, raw=False, headerOnly=False): def getBlockData(self, bHash, decrypt=False, raw=False, headerOnly=False):
return self.get_block_data.get_block_data(bHash, decrypt=decrypt, raw=raw, headerOnly=headerOnly) return self.get_block_data.get_block_data(bHash, decrypt=decrypt, raw=raw, headerOnly=headerOnly)

View File

@ -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:
''' '''

View File

@ -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

View File

@ -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('-', ' ')))

View File

@ -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():

View File

@ -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'))