示例#1
0
 def _new_version(self):
     self.start_height = 888
     caps = [
         capabilities.FullNodeCapability(start_height=self.start_height),
         capabilities.ServerCapability(
             capabilities.NodeCapabilityType.TCPSERVER, 10333)
     ]
     return payloads.VersionPayload(nonce=123,
                                    user_agent="NEO3-MOCK-CLIENT",
                                    capabilities=caps)
示例#2
0
 def __init__(self, loop, hostaddr: str, port: int):
     super(NeoNodeSocketMock, self).__init__()
     self.type = socket.SOCK_STREAM
     self.recv_buffer = bytearray()
     self.loop = loop
     self.hostaddr = hostaddr
     self.port = port
     self.recv_data = self._recv_data()
     caps = [capabilities.FullNodeCapability(0),
             capabilities.ServerCapability(n_type=capabilities.NodeCapabilityType.TCPSERVER, port=10333)]
     self.m_send_version = message.Message(msg_type=message.MessageType.VERSION,
                                           payload=payloads.VersionPayload(nonce=123,
                                                                           user_agent="NEO3-MOCK-CLIENT",
                                                                           capabilities=caps))
     self.m_verack = message.Message(msg_type=message.MessageType.VERACK)