From cde285ccfcdd699cd99c10f92ea2006bfc04208d Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 30 May 2014 18:46:11 +1000 Subject: [PATCH] Wallet: enforce operator new --- src/wallet.js | 2 -- test/wallet.js | 4 ---- 2 files changed, 6 deletions(-) diff --git a/src/wallet.js b/src/wallet.js index 58b5748..0d41bb2 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -6,8 +6,6 @@ var HDNode = require('./hdwallet') var Transaction = require('./transaction').Transaction function Wallet(seed, network) { - if (!(this instanceof Wallet)) { return new Wallet(seed, options); } - network = network || networks.bitcoin // Stored in a closure to make accidental serialization less likely diff --git a/test/wallet.js b/test/wallet.js index e54d603..ef2d152 100644 --- a/test/wallet.js +++ b/test/wallet.js @@ -25,10 +25,6 @@ describe('Wallet', function() { }) describe('constructor', function() { - it('should be ok to call without new', function() { - assert.ok(Wallet(seed) instanceof Wallet) - }) - it('defaults to Bitcoin network', function() { assert.equal(wallet.getMasterKey().network, networks.bitcoin) })