Skip to content

Commit

Permalink
Merge masterkey
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Sep 28, 2021
1 parent 6499c14 commit 1b76a47
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 30 deletions.
2 changes: 1 addition & 1 deletion experiment/popularity_community/initial_filling.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ipv8_service import IPv8
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.popularity import PopularityComponent
from tribler_core.components.restapi import RESTComponent
Expand Down
2 changes: 1 addition & 1 deletion experiment/tunnel_community/hidden_peer_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from ipv8.taskmanager import TaskManager
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.components.tunnels import TunnelsComponent
from tribler_core.config.tribler_config import TriblerConfig
Expand Down
2 changes: 1 addition & 1 deletion experiment/tunnel_community/speed_test_exit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ipv8.messaging.anonymization.utils import run_speed_test
from ipv8.taskmanager import TaskManager
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.components.tunnels import TunnelsComponent
from tribler_core.config.tribler_config import TriblerConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent
from tribler_core.components.base import Session
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.restapi.rest_manager import RESTManager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from tribler_core.components.base import Session
from tribler_core.components.gigachannel.gigachannel_component import GigaChannelComponent
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.restapi.rest_manager import RESTManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from tribler_core.components.base import Session
from tribler_core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.components.socks_configurator import SocksServersComponent
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/ipv8.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ipv8.taskmanager import TaskManager
from ipv8_service import IPv8
from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.restapi.rest_manager import RESTManager
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/libtorrent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tribler_common.simpledefs import STATE_CHECKPOINTS_LOADED, STATE_LOAD_CHECKPOINTS, STATE_START_LIBTORRENT
from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.components.socks_configurator import SocksServersComponent
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import tribler_core.utilities.permid as permid_module
import tribler_core.components.masterkey.permid as permid_module
from ipv8.keyvault.private.libnaclkey import LibNaCLSK
from tribler_core.components.base import Component

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest

from tribler_core.components.base import Session
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent


@pytest.mark.asyncio
async def test_masterkey_component(tribler_config):
session = Session(tribler_config, [MasterKeyComponent()])
with session:
comp = MasterKeyComponent.instance()
await session.start()

assert comp.keypair

await session.shutdown()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tribler_common.simpledefs import NTFY, STATEDIR_DB_DIR
from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.components.upgrade import UpgradeComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from unittest.mock import patch

from tribler_core.components.base import Session
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.restapi.rest_manager import RESTManager
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/reporter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tribler_common.sentry_reporter.sentry_reporter import SentryReporter
from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.utilities.unicode import hexlify


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tribler_core.components.base import Session, SessionError
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.payout import PayoutComponent
from tribler_core.components.popularity import PopularityComponent
Expand Down Expand Up @@ -50,17 +50,6 @@ def test_session_context_manager(loop, tribler_config):
Session.current()


async def test_masterkey_component(tribler_config):
session = Session(tribler_config, [MasterKeyComponent()])
with session:
comp = MasterKeyComponent.instance()
await session.start()

assert comp.keypair

await session.shutdown()


async def test_ipv8_component(tribler_config):
components = [MasterKeyComponent(), RESTComponent(), Ipv8Component()]
session = Session(tribler_config, components)
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/upgrade.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tribler_common.simpledefs import STATE_UPGRADING_READABLE
from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RESTComponent
from tribler_core.upgrade.upgrade import TriblerUpgrader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tribler_core.modules.popularity.settings import PopularityCommunitySettings
from tribler_core.modules.remote_query_community.settings import RemoteQueryCommunitySettings
from tribler_core.modules.resource_monitor.settings import ResourceMonitorSettings
from tribler_core.modules.settings import BootstrapSettings, DHTSettings, DiscoveryCommunitySettings, Ipv8Settings, \
from tribler_core.components.masterkey.settings import BootstrapSettings, DHTSettings, DiscoveryCommunitySettings, Ipv8Settings, \
TrustchainSettings, WatchFolderSettings
from tribler_core.modules.torrent_checker.settings import TorrentCheckerSettings
from tribler_core.modules.tunnel.community.settings import TunnelCommunitySettings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from tribler_common.network_utils import NetworkUtils
from tribler_core.modules.settings import Ipv8Settings
from tribler_core.components.masterkey.settings import Ipv8Settings


@pytest.mark.asyncio
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/start_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from tribler_core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.payout import PayoutComponent
from tribler_core.components.popularity import PopularityComponent
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/tests/test_permid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ipv8.keyvault.private.libnaclkey import LibNaCLSK

from tribler_core.utilities import permid
from tribler_core.components.masterkey import permid


def test_save_load_keypair_pubkey_trustchain(tmpdir):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from tribler_common.simpledefs import NTFY

import tribler_core.utilities.permid as permid_module
import tribler_core.components.masterkey.permid as permid_module
from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase
from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import CHANNEL_DIR_NAME_LENGTH
from tribler_core.components.metadata_store.db.store import CURRENT_DB_VERSION, MetadataStore
Expand Down

0 comments on commit 1b76a47

Please sign in to comment.