Skip to content

Commit

Permalink
Fix compilation on 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Oct 31, 2022
1 parent 9cc4180 commit 06c1f31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libp2p/transports/tortransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ proc new*(
rng: ref HmacDrbgContext,
addresses: seq[MultiAddress] = @[],
flags: set[ServerFlags] = {}): TorSwitch
{.raises: [LPError], public.} =
{.raises: [LPError, Defect], public.} =
var builder = SwitchBuilder.new()
.withRng(rng)
.withTransport(proc(upgr: Upgrade): Transport = TorTransport.new(torServer, flags, upgr))
Expand Down
2 changes: 1 addition & 1 deletion tests/testtcptransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ suite "TCP transport":
await server.join()

proc transProvider(): Transport = TcpTransport.new(upgrade = Upgrade())

commonTransportTest(
transProvider,
"/ip4/0.0.0.0/tcp/0")
3 changes: 3 additions & 0 deletions tests/testtortransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ suite "Tor transport":
await serverSwitch.stop()

test "It's not possible to add another transport":
when (NimMajor, NimMinor, NimPatch) < (1, 4, 0):
type AssertionDefect = AssertionError

let torSwitch = TorSwitch.new(torServer = torServer, rng= rng, flags = {ReuseAddr})
expect(AssertionDefect):
torSwitch.addTransport(TcpTransport.new(upgrade = Upgrade()))
Expand Down

0 comments on commit 06c1f31

Please sign in to comment.