Skip to content

Commit

Permalink
Merge 7715aff into 0bdb4f4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dvisacker committed Feb 24, 2018
2 parents 0bdb4f4 + 7715aff commit 4178355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -13,8 +13,8 @@ module.exports = SignerProvider;
*/
function SignerProvider(path, options) {
if (!(this instanceof SignerProvider)) { throw new Error('[ethjs-provider-signer] the SignerProvider instance requires the "new" flag in order to function normally (e.g. `const eth = new Eth(new SignerProvider(...));`).'); }
if (typeof options !== 'object') { throw new Error(`[ethjs-provider-signer] the SignerProvider requires an options object be provided with the 'privateKey' property specified, you provided type ${typeof options}.`); }
if (typeof options.signTransaction !== 'function') { throw new Error(`[ethjs-provider-signer] the SignerProvider requires an options object be provided with the 'signTransaction' property specified, you provided type ${typeof options.privateKey} (e.g. 'const eth = new Eth(new SignerProvider("http://ropsten.infura.io", { privateKey: (account, cb) => cb(null, 'some private key') }));').`); }
if (typeof options !== 'object') { throw new Error(`[ethjs-provider-signer] the SignerProvider requires an options object be provided with the 'signTransaction' property specified, you provided type ${typeof options}.`); }
if (typeof options.signTransaction !== 'function') { throw new Error(`[ethjs-provider-signer] the SignerProvider requires an options object be provided with the 'signTransaction' property specified, you provided type ${typeof options.signTransaction} (e.g. 'const eth = new Eth(new SignerProvider("http://ropsten.infura.io", { signTransaction: (account, cb) => cb(null, 'some private key') }));').`); }

const self = this;
self.options = Object.assign({
Expand Down

0 comments on commit 4178355

Please sign in to comment.