def p2ptrade_init(self): ewctrl = EWalletController(self.model, self.controller) config = {"offer_expiry_interval": 30, "ep_expiry_interval": 30} comm = HTTPComm(config, 'http://p2ptrade.btx.udoidio.info/messages') self.thread_comm = ThreadedComm(comm) self.p2p_agent = EAgent(ewctrl, config, self.thread_comm) self.thread_comm.start()
def setUp(self): self.config = {"offer_expiry_interval": 30, "ep_expiry_interval": 30} self.hcomm = HTTPComm(self.config) self.msg = {"msgid": 2, "a": "b"} self.httpd = TestServer("localhost", 8080) self.httpd.start() self.tcomm = ThreadedComm(self.hcomm) self.tcomm.add_agent(MockAgent())
def setUp(self): self.config = { 'offer_expiry_interval' : 1} self.url = 'http://localhost:8080/messages' self.comm = HTTPComm(self.config, self.url) self.http_interface = MockHTTPInterface() self.comm.http_interface = self.http_interface self.agent = MockAgent() self.comm.add_agent(self.agent)
def init_p2ptrade(self): from ngcccbase.p2ptrade.ewctrl import EWalletController from ngcccbase.p2ptrade.agent import EAgent from ngcccbase.p2ptrade.comm import HTTPComm ewctrl = EWalletController(self.model, self.controller) config = {"offer_expiry_interval": 30, "ep_expiry_interval": 30} comm = HTTPComm(config, 'http://p2ptrade.btx.udoidio.info/messages') agent = EAgent(ewctrl, config, comm) return agent
def _init_p2ptrade(self): ewctrl = EWalletController(self.model, self.controller) config = {"offer_expiry_interval": 30, "ep_expiry_interval": 30} comm = HTTPComm(config, 'http://p2ptrade.btx.udoidio.info/messages') return EAgent(ewctrl, config, comm)