from twisted.internet.error import (ConnectionLost, ConnectionAborted,
                                    ConnectionClosed, ConnectionDone)
from twisted.protocols.amp import UnknownRemoteError
from twisted.python import failure
from twisted.protocols import amp
from twisted.trial import unittest
from jmbase.commands import *
from msgdata import *
import json
import time
import base64
from dummy_mc import DummyMessageChannel
from test_message_channel import make_valid_nick
test_completed = False
end_early = False
jlog = get_log()

class DummyMC(DummyMessageChannel):
    #override run() for twisted compatibility
    def run(self):
        if self.on_welcome:
            reactor.callLater(1, self.on_welcome, self)

class JMProtocolError(Exception):
    pass

class JMBaseProtocol(amp.AMP):
    def checkClientResponse(self, response):
        """A generic check of client acceptance; any failure
        is considered criticial.
        """
Ejemplo n.º 2
0
from electrum.i18n import _
from electrum_gui.qt.util import *
from electrum.bitcoin import TESTNET

from functools import partial

import sys, os

sys.path.insert(0, os.path.dirname(__file__))

from jmclient import (load_program_config, jm_single, get_log,
                      set_commitment_file)
from walletwrap import ElectrumWrapWallet
from joinmarket_gui import (JMQtMessageBox, JoinmarketTab, SettingsDialog,
                            update_config_for_gui)
log = get_log()

class Plugin(BasePlugin):

    def __init__(self, parent, config, name):
        BasePlugin.__init__(self, parent, config, name)
        self.in_use = False
        self.config_location = None
        self.started = False

    @hook
    def init_qt(self, gui):
        """We actually only support one
        main ElectrumWindow; TODO perhaps simplify
        """
        for window in gui.windows: