Moved protocol to network module
This commit is contained in:
parent
65d2a37cb2
commit
48e8f0534c
|
@ -73,13 +73,13 @@ from six.moves import configparser, http_client, xmlrpc_server
|
||||||
|
|
||||||
import helper_inbox
|
import helper_inbox
|
||||||
import helper_sent
|
import helper_sent
|
||||||
import protocol
|
|
||||||
import proofofwork
|
import proofofwork
|
||||||
import queues
|
import queues
|
||||||
import shared
|
import shared
|
||||||
|
|
||||||
import shutdown
|
import shutdown
|
||||||
import state
|
import state
|
||||||
|
import network.protocol as protocol
|
||||||
from addresses import (
|
from addresses import (
|
||||||
addBMIfNotPresent,
|
addBMIfNotPresent,
|
||||||
decodeAddress,
|
decodeAddress,
|
||||||
|
|
|
@ -19,10 +19,10 @@ import helper_msgcoding
|
||||||
import helper_sent
|
import helper_sent
|
||||||
import highlevelcrypto
|
import highlevelcrypto
|
||||||
import l10n
|
import l10n
|
||||||
import protocol
|
|
||||||
import queues
|
import queues
|
||||||
import shared
|
import shared
|
||||||
import state
|
import state
|
||||||
|
import network.protocol as protocol
|
||||||
from addresses import (
|
from addresses import (
|
||||||
decodeAddress, decodeVarint,
|
decodeAddress, decodeVarint,
|
||||||
encodeAddress, encodeVarint, varintDecodeError
|
encodeAddress, encodeVarint, varintDecodeError
|
||||||
|
|
|
@ -20,11 +20,11 @@ import helper_sql
|
||||||
import highlevelcrypto
|
import highlevelcrypto
|
||||||
import l10n
|
import l10n
|
||||||
import proofofwork
|
import proofofwork
|
||||||
import protocol
|
|
||||||
import queues
|
import queues
|
||||||
import shared
|
import shared
|
||||||
import state
|
import state
|
||||||
import tr
|
import tr
|
||||||
|
import network.protocol as protocol
|
||||||
from addresses import decodeAddress, decodeVarint, encodeVarint
|
from addresses import decodeAddress, decodeVarint, encodeVarint
|
||||||
from bmconfigparser import config
|
from bmconfigparser import config
|
||||||
from helper_sql import sqlExecute, sqlQuery
|
from helper_sql import sqlExecute, sqlQuery
|
||||||
|
|
|
@ -4,8 +4,8 @@ BMObject and it's exceptions.
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import protocol
|
|
||||||
import state
|
import state
|
||||||
|
import protocol
|
||||||
import connectionpool
|
import connectionpool
|
||||||
from network import dandelion_ins
|
from network import dandelion_ins
|
||||||
from highlevelcrypto import calculateInventoryHash
|
from highlevelcrypto import calculateInventoryHash
|
||||||
|
|
|
@ -13,9 +13,9 @@ import time
|
||||||
# magic imports!
|
# magic imports!
|
||||||
import addresses
|
import addresses
|
||||||
import knownnodes
|
import knownnodes
|
||||||
import protocol
|
|
||||||
import state
|
import state
|
||||||
import connectionpool
|
import connectionpool
|
||||||
|
import protocol
|
||||||
from bmconfigparser import config
|
from bmconfigparser import config
|
||||||
from queues import invQueue, objectProcessorQueue, portCheckerQueue
|
from queues import invQueue, objectProcessorQueue, portCheckerQueue
|
||||||
from randomtrackingdict import RandomTrackingDict
|
from randomtrackingdict import RandomTrackingDict
|
||||||
|
|
|
@ -6,8 +6,8 @@ import logging
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import knownnodes
|
import knownnodes
|
||||||
import protocol
|
|
||||||
import state
|
import state
|
||||||
|
import protocol
|
||||||
from bmconfigparser import config
|
from bmconfigparser import config
|
||||||
from queues import queue, portCheckerQueue
|
from queues import queue, portCheckerQueue
|
||||||
|
|
||||||
|
|
|
@ -13,16 +13,26 @@ import time
|
||||||
from binascii import hexlify
|
from binascii import hexlify
|
||||||
from struct import Struct, pack, unpack
|
from struct import Struct, pack, unpack
|
||||||
|
|
||||||
import defaults
|
try:
|
||||||
import highlevelcrypto
|
import defaults
|
||||||
import state
|
import highlevelcrypto
|
||||||
from addresses import (
|
import state
|
||||||
|
from addresses import (
|
||||||
encodeVarint, decodeVarint, decodeAddress, varintDecodeError)
|
encodeVarint, decodeVarint, decodeAddress, varintDecodeError)
|
||||||
from bmconfigparser import config
|
from bmconfigparser import config
|
||||||
from debug import logger
|
from debug import logger
|
||||||
from helper_sql import sqlExecute
|
from helper_sql import sqlExecute
|
||||||
from network.node import Peer
|
from version import softwareVersion
|
||||||
from version import softwareVersion
|
except ImportError:
|
||||||
|
from pybitmessage import defaults, highlevelcrypto, state
|
||||||
|
from pybitmessage.addresses import (
|
||||||
|
encodeVarint, decodeVarint, decodeAddress, varintDecodeError)
|
||||||
|
from pybitmessage.bmconfigparser import config
|
||||||
|
from pybitmessage.debug import logger
|
||||||
|
from pybitmessage.helper_sql import sqlExecute
|
||||||
|
from pybitmessage.version import softwareVersion
|
||||||
|
|
||||||
|
from .node import Peer
|
||||||
|
|
||||||
# Network constants
|
# Network constants
|
||||||
magic = 0xE9BEB4D9
|
magic = 0xE9BEB4D9
|
|
@ -16,10 +16,10 @@ import threading
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import protocol
|
|
||||||
import state
|
import state
|
||||||
import helper_sent
|
import helper_sent
|
||||||
import helper_addressbook
|
import helper_addressbook
|
||||||
|
import network.protocol as protocol
|
||||||
|
|
||||||
from bmconfigparser import config
|
from bmconfigparser import config
|
||||||
from helper_msgcoding import MsgEncode, MsgDecode
|
from helper_msgcoding import MsgEncode, MsgDecode
|
||||||
|
|
|
@ -7,7 +7,7 @@ from struct import pack
|
||||||
|
|
||||||
from six.moves import queue, xmlrpc_client
|
from six.moves import queue, xmlrpc_client
|
||||||
|
|
||||||
from pybitmessage import protocol
|
from pybitmessage.network import protocol
|
||||||
from pybitmessage.highlevelcrypto import calculateInventoryHash
|
from pybitmessage.highlevelcrypto import calculateInventoryHash
|
||||||
|
|
||||||
from .partial import TestPartialRun
|
from .partial import TestPartialRun
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
from binascii import unhexlify
|
from binascii import unhexlify
|
||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
from pybitmessage import addresses, protocol
|
from pybitmessage import addresses
|
||||||
|
from pybitmessage.network import protocol
|
||||||
|
|
||||||
from .samples import (
|
from .samples import (
|
||||||
sample_addr_data, sample_object_data, sample_object_expires)
|
sample_addr_data, sample_object_data, sample_object_expires)
|
||||||
|
|
|
@ -5,7 +5,8 @@ Tests for common protocol functions
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from pybitmessage import protocol, state
|
from pybitmessage import state
|
||||||
|
from pybitmessage.network import protocol
|
||||||
from pybitmessage.helper_startup import fixSocket
|
from pybitmessage.helper_startup import fixSocket
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user