diff --git a/lib/protocol/network.js b/lib/protocol/network.js index 62e8fdb8c..03f654974 100644 --- a/lib/protocol/network.js +++ b/lib/protocol/network.js @@ -131,9 +131,12 @@ class Network { static create(options) { if (typeof options === 'string') options = networks[options]; - + + if(options instanceof Object) + assert(!options.type, 'Unknown network.'); + assert(options, 'Unknown network.'); - + if (Network[options.type]) return Network[options.type];