mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-09 03:08:21 -05:00
adding raises defect across the codebase (#572)
* adding raises defect across the codebase * use unittest2 * add windows deps caching * update mingw link * die on failed peerinfo initialization * use result.expect instead of get * use expect more consistently and rework inits * use expect more consistently * throw on missing public key * remove unused closure annotation * merge master
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
## This file may not be copied, modified, or distributed except according to
|
||||
## those terms.
|
||||
|
||||
{.push raises: [Defect].}
|
||||
|
||||
import std/[sequtils, sets, hashes, tables]
|
||||
import chronos, chronicles, metrics, bearssl
|
||||
import ./pubsub,
|
||||
@@ -201,7 +203,8 @@ method publish*(f: FloodSub,
|
||||
|
||||
return peers.len
|
||||
|
||||
method initPubSub*(f: FloodSub) =
|
||||
method initPubSub*(f: FloodSub)
|
||||
{.raises: [Defect, InitializationError].} =
|
||||
procCall PubSub(f).initPubSub()
|
||||
f.seen = TimedCache[MessageID].init(2.minutes)
|
||||
var rng = newRng()
|
||||
|
||||
Reference in New Issue
Block a user