remove init in favor of upstream init

This commit is contained in:
Dmitriy Ryajov 2019-10-11 07:28:06 +09:00
parent a4431a86a1
commit 21af081066
1 changed files with 0 additions and 17 deletions

View File

@ -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