Skip to content

Commit

Permalink
Add Discv5 banned nodes enabled tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhartnett committed Jan 24, 2025
1 parent 854f17c commit aab3ca0
Show file tree
Hide file tree
Showing 3 changed files with 599 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/p2p/all_discv5_tests.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import
./test_ip_vote,
./test_routing_table,
./test_discoveryv5_encoding,
./test_discoveryv5
./test_discoveryv5,
./test_discoveryv5_bannodes
6 changes: 4 additions & 2 deletions tests/p2p/discv5_test_helper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ proc initDiscoveryNode*(
address: Address,
bootstrapRecords: openArray[Record] = [],
localEnrFields: openArray[(string, seq[byte])] = [],
previousRecord = Opt.none(enr.Record)):
previousRecord = Opt.none(enr.Record),
banNodes = false):
discv5_protocol.Protocol =
# set bucketIpLimit to allow bucket split
let config = DiscoveryConfig.init(1000, 24, 5)
Expand All @@ -36,7 +37,8 @@ proc initDiscoveryNode*(
localEnrFields = localEnrFields,
previousRecord = previousRecord,
config = config,
rng = rng)
rng = rng,
banNodes = banNodes)

protocol.open()

Expand Down
Loading

0 comments on commit aab3ca0

Please sign in to comment.