From 21af0810663901abc832ff7f29e3920a9f22392a Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 11 Oct 2019 07:28:06 +0900 Subject: [PATCH] remove init in favor of upstream init --- libp2p/multiaddress.nim | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libp2p/multiaddress.nim b/libp2p/multiaddress.nim index dc2cf3bd6..c9abd49e7 100644 --- a/libp2p/multiaddress.nim +++ b/libp2p/multiaddress.nim @@ -633,23 +633,6 @@ proc validate*(ma: MultiAddress): bool = discard result = true -proc init*(mtype: typedesc[MultiAddress], address: TransportAddress): MultiAddress = - ## Returns a multiaddr of ``address``. - case address.family - of AddressFamily.IPv4: - var a = IpAddress( - family: IpAddressFamily.IPv4, - address_v4: address.address_v4 - ) - result = MultiAddress.init(a, Protocol.IPPROTO_TCP, address.port) - of AddressFamily.IPv6: - var a = IpAddress(family: IpAddressFamily.IPv6, - address_v6: address.address_v6) - result = MultiAddress.init(a, Protocol.IPPROTO_TCP, address.port) - else: - raise newException(TransportAddressError, - "Invalid address for transport!") - proc init*(mtype: typedesc[MultiAddress], protocol: MultiCodec, value: openarray[byte]): MultiAddress = ## Initialize MultiAddress object from protocol id ``protocol`` and array