fix memory safety issue in tests (#484)

This commit is contained in:
Dmitriy Ryajov 2020-12-14 15:22:53 -06:00 committed by GitHub
parent 42d264d8b0
commit 4224f12503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -513,7 +513,8 @@ suite "GossipSub":
var seen: Table[string, int]
var seenFut = newFuture[void]()
for dialer in nodes:
for i in 0..<nodes.len:
let dialer = nodes[i]
var handler: TopicHandler
closureScope:
var peerName = $dialer.peerInfo.peerId
@ -564,7 +565,8 @@ suite "GossipSub":
var seen: Table[string, int]
var seenFut = newFuture[void]()
for dialer in nodes:
for i in 0..<nodes.len:
let dialer = nodes[i]
var handler: TopicHandler
closureScope:
var peerName = $dialer.peerInfo.peerId