code cleanup

This commit is contained in:
munna0908 2025-01-07 19:32:17 +05:30
parent beae8a4283
commit 2bae744c5c
No known key found for this signature in database
GPG Key ID: 2FFCD637E937D3E6
3 changed files with 3 additions and 4 deletions

View File

@ -40,10 +40,9 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
try: try:
exec(cmd) exec(cmd)
finally: finally:
if defined(macosx): if defined(macosx):
renameFile(newVersionFile, oldVersionFile) renameFile(newVersionFile, oldVersionFile)
proc test(name: string, srcDir = "tests/", params = "", lang = "c") = proc test(name: string, srcDir = "tests/", params = "", lang = "c") =
buildBinary name, srcDir, params buildBinary name, srcDir, params
exec "build/" & name exec "build/" & name

View File

@ -90,4 +90,4 @@ proc getAddressAndPort*(ma: MultiAddress): tuple[ip: Option[ValidIpAddress], por
result = (ip: ip, port: port) result = (ip: ip, port: port)
except Exception: except Exception:
result = (ip: none(ValidIpAddress), port: none(Port)) result = (ip: none(ValidIpAddress), port: none(Port))

View File

@ -43,4 +43,4 @@ suite "NAT Address Tests":
# Verify results # Verify results
check(discoveryAddrs == expectedDiscoveryAddrs) check(discoveryAddrs == expectedDiscoveryAddrs)
check(libp2pAddrs == expectedlibp2pAddrs) check(libp2pAddrs == expectedlibp2pAddrs)