Update tests for new logic

This commit is contained in:
Alex Stokes
2019-08-02 18:36:58 -07:00
parent 9e18d7561d
commit cda74dd382
4 changed files with 122 additions and 49 deletions

View File

@ -3,6 +3,8 @@ from contextlib import suppress
import multiaddr
from Crypto.PublicKey import RSA
from libp2p import new_node
from libp2p.peer.peerinfo import info_from_p2p_addr
@ -53,3 +55,8 @@ async def perform_two_host_set_up_custom_handler(handler):
# Associate the peer with local ip address (see default parameters of Libp2p())
node_a.get_peerstore().add_addrs(node_b.get_id(), node_b.get_addrs(), 10)
return node_a, node_b
def generate_new_private_key():
new_key = RSA.generate(2048, e=65537)
return new_key