dev@locazia: fix circular import
This commit is contained in:
parent
4a51efed01
commit
23ed777400
|
|
@ -12,8 +12,6 @@ if not os.path.exists(UPLOADS_DIR):
|
|||
os.makedirs(UPLOADS_DIR)
|
||||
|
||||
CONFIG_FILE = os.getenv('CONFIG_FILE') or f"{UPLOADS_DIR}/../config"
|
||||
from app.core.models._config import ConfigFile
|
||||
config_manager = ConfigFile(CONFIG_FILE)
|
||||
|
||||
TELEGRAM_API_KEY = os.environ.get('TELEGRAM_API_KEY')
|
||||
assert TELEGRAM_API_KEY, "Telegram API_KEY required"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from nacl.bindings import crypto_sign_seed_keypair
|
||||
from app.core._config import config_manager
|
||||
from app.core.active_config import active_config
|
||||
from app.core.logger import make_log
|
||||
from app.core._blockchain.ton.wallet_v3cr3 import WalletV3CR3
|
||||
from os import urandom, getenv
|
||||
|
|
@ -7,11 +7,11 @@ from tonsdk.utils import Address
|
|||
|
||||
|
||||
def load_hot_pair():
|
||||
hot_seed = config_manager.get('private_key')
|
||||
hot_seed = active_config.get('private_key')
|
||||
if hot_seed is None:
|
||||
make_log("HotWallet", "No seed found, generating new one", level='info')
|
||||
hot_seed = urandom(32).hex()
|
||||
config_manager.set('private_key', hot_seed)
|
||||
active_config.set('private_key', hot_seed)
|
||||
return load_hot_pair()
|
||||
|
||||
public_key, private_key = crypto_sign_seed_keypair(bytes.fromhex(hot_seed))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
from app.core.models._config import ConfigFile
|
||||
from app.core._config import CONFIG_FILE
|
||||
|
||||
active_config = ConfigFile(CONFIG_FILE)
|
||||
Loading…
Reference in New Issue