remove unused code

This commit is contained in:
zixuanzh 2019-04-02 21:17:48 -04:00
parent 41d1aae55b
commit 0238dff217
2 changed files with 0 additions and 14 deletions

View File

@ -1,5 +1,4 @@
import asyncio import asyncio
import uuid
from .pb import rpc_pb2 from .pb import rpc_pb2
from .pubsub_notifee import PubsubNotifee from .pubsub_notifee import PubsubNotifee
@ -202,10 +201,6 @@ class Pubsub():
# Create subscribe message # Create subscribe message
packet = rpc_pb2.RPC() packet = rpc_pb2.RPC()
# packet.publish.extend([rpc_pb2.Message(
# from_id=str(self.host.get_id()).encode('utf-8'),
# seqno=str(generate_message_id()).encode('utf-8')
# )])
packet.subscriptions.extend([rpc_pb2.RPC.SubOpts( packet.subscriptions.extend([rpc_pb2.RPC.SubOpts(
subscribe=True, subscribe=True,
topicid=topic_id.encode('utf-8') topicid=topic_id.encode('utf-8')
@ -255,10 +250,3 @@ class Pubsub():
# Write message to stream # Write message to stream
await stream.write(rpc_msg) await stream.write(rpc_msg)
def generate_message_id():
"""
Generate a unique message id
:return: messgae id
"""
return str(uuid.uuid1())

View File

@ -54,8 +54,6 @@ async def test_simple_two_nodes_RPC():
# as the message sent by node_a # as the message sent by node_a
assert res_b.SerializeToString() == msg.publish[0].SerializeToString() assert res_b.SerializeToString() == msg.publish[0].SerializeToString()
# Success, terminate pending tasks. # Success, terminate pending tasks.
await cleanup() await cleanup()