From e35d81e898f95cd01f3793a3a0b9f2e20d7399db Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 17 Mar 2020 12:18:10 -0300 Subject: [PATCH] Remove broken default provider The provider is now a required option. This seemed preferable to embedding another default provider that might also become obsolete. It's commonplace for eth-related libraries to require a provider to be passed in. --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 17cf978..78a1b73 100644 --- a/index.js +++ b/index.js @@ -5,8 +5,10 @@ const abi = require('./abi') class MethodRegistry { constructor (opts = {}) { - this.provider = opts.provider || - new Eth.HttpProvider('https://mainnet.infura.io/eth-contract-registry') + if (!opts.provider) { + throw new Error("Missing required 'provider' option") + } + this.provider = opts.provider this.eth = new Eth(this.provider) const address = registryMap[opts.network || '1']