moved dbcreator to onionrsetup
This commit is contained in:
		
							parent
							
								
									2a6782f88d
								
							
						
					
					
						commit
						e4df34ef29
					
				
					 7 changed files with 9 additions and 7 deletions
				
			
		|  | @ -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: | ||||
|     ''' | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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('-', ' '))) | ||||
|  |  | |||
|  | @ -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(): | ||||
|  |  | |||
|  | @ -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')) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue