Skip to content

Commit

Permalink
Moved protocol to network module
Browse files Browse the repository at this point in the history
  • Loading branch information
anand-skss committed Jun 27, 2024
1 parent e578759 commit ecf4f0e
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@

import helper_inbox
import helper_sent
import protocol
import proofofwork
import queues
import shared

import shutdown
import state
import network.protocol as protocol
from addresses import (
addBMIfNotPresent,
decodeAddress,
Expand Down
2 changes: 1 addition & 1 deletion src/class_objectProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import helper_sent
import highlevelcrypto
import l10n
import protocol
import queues
import shared
import state
import network.protocol as protocol
from addresses import (
decodeAddress, decodeVarint,
encodeAddress, encodeVarint, varintDecodeError
Expand Down
2 changes: 1 addition & 1 deletion src/class_singleWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import highlevelcrypto
import l10n
import proofofwork
import protocol
import queues
import shared
import state
import tr
import network.protocol as protocol
from addresses import decodeAddress, decodeVarint, encodeVarint
from bmconfigparser import config
from helper_sql import sqlExecute, sqlQuery
Expand Down
2 changes: 1 addition & 1 deletion src/network/bmobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import logging
import time

import protocol
import state
import protocol
import connectionpool
from network import dandelion_ins
from highlevelcrypto import calculateInventoryHash
Expand Down
2 changes: 1 addition & 1 deletion src/network/bmproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# magic imports!
import addresses
import knownnodes
import protocol
import state
import connectionpool
import protocol
from bmconfigparser import config
from queues import invQueue, objectProcessorQueue, portCheckerQueue
from randomtrackingdict import RandomTrackingDict
Expand Down
2 changes: 1 addition & 1 deletion src/network/connectionchooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import random

import knownnodes
import protocol
import state
import protocol
from bmconfigparser import config
from queues import queue, portCheckerQueue

Expand Down
10 changes: 7 additions & 3 deletions src/protocol.py → src/network/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
from binascii import hexlify
from struct import Struct, pack, unpack

import defaults
import highlevelcrypto
import state
try:
import defaults
import highlevelcrypto
import state
except ImportError:
from pybitmessage import defaults, highlevelcrypto, state

from addresses import (
encodeVarint, decodeVarint, decodeAddress, varintDecodeError)
from bmconfigparser import config
Expand Down
2 changes: 1 addition & 1 deletion src/tests/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import time
import unittest

import protocol
import state
import helper_sent
import helper_addressbook
import network.protocol as protocol

from bmconfigparser import config
from helper_msgcoding import MsgEncode, MsgDecode
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_api_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from six.moves import queue, xmlrpc_client

from pybitmessage import protocol
from pybitmessage.network import protocol
from pybitmessage.highlevelcrypto import calculateInventoryHash

from .partial import TestPartialRun
Expand Down
3 changes: 2 additions & 1 deletion src/tests/test_packets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from binascii import unhexlify
from struct import pack

from pybitmessage import addresses, protocol
import addresses
from network import protocol

from .samples import (
sample_addr_data, sample_object_data, sample_object_expires)
Expand Down
5 changes: 3 additions & 2 deletions src/tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import sys
import unittest

from pybitmessage import protocol, state
from pybitmessage.helper_startup import fixSocket
import state
from network import protocol
from helper_startup import fixSocket


class TestSocketInet(unittest.TestCase):
Expand Down

0 comments on commit ecf4f0e

Please sign in to comment.