aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2017-10-19 06:09:32 +0800
committerGitHub <noreply@github.com>2017-10-19 06:09:32 +0800
commit8da0d0b28a52d476da3623774159e8d6a595da2d (patch)
treed35cd3391ca2dda9626f6076cbff1e3da0e02c97 /test/unit
parent5eeb1440468cb77111fd09d01b85b4b9a5264766 (diff)
downloadtangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar
tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.gz
tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.bz2
tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.lz
tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.xz
tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.zst
tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.zip
Revert "NetworkController refactor for new EthClient interface"
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/network-contoller-test.js25
-rw-r--r--test/unit/nonce-tracker-test.js7
2 files changed, 23 insertions, 9 deletions
diff --git a/test/unit/network-contoller-test.js b/test/unit/network-contoller-test.js
index 42ca40c56..0b3b5adeb 100644
--- a/test/unit/network-contoller-test.js
+++ b/test/unit/network-contoller-test.js
@@ -14,15 +14,15 @@ describe('# Network Controller', function () {
},
})
- networkController.initializeProvider(networkControllerProviderInit)
+ networkController.initializeProvider(networkControllerProviderInit, dummyProviderConstructor)
})
describe('network', function () {
describe('#provider', function () {
it('provider should be updatable without reassignment', function () {
- networkController.initializeProvider(networkControllerProviderInit)
- const providerProxy = networkController.providerProxy
- providerProxy.setTarget({ test: true })
- assert.ok(providerProxy.test)
+ networkController.initializeProvider(networkControllerProviderInit, dummyProviderConstructor)
+ const proxy = networkController._proxy
+ proxy.setTarget({ test: true, on: () => {} })
+ assert.ok(proxy.test)
})
})
describe('#getNetworkState', function () {
@@ -66,4 +66,19 @@ describe('# Network Controller', function () {
})
})
+function dummyProviderConstructor() {
+ return {
+ // provider
+ sendAsync: noop,
+ // block tracker
+ _blockTracker: {},
+ start: noop,
+ stop: noop,
+ on: noop,
+ addListener: noop,
+ once: noop,
+ removeAllListeners: noop,
+ }
+}
+
function noop() {} \ No newline at end of file
diff --git a/test/unit/nonce-tracker-test.js b/test/unit/nonce-tracker-test.js
index 77af2a21c..8970cf84d 100644
--- a/test/unit/nonce-tracker-test.js
+++ b/test/unit/nonce-tracker-test.js
@@ -190,13 +190,12 @@ function generateNonceTrackerWith (pending, confirmed, providerStub = '0x0') {
providerResultStub.result = providerStub
const provider = {
sendAsync: (_, cb) => { cb(undefined, providerResultStub) },
- }
- const blockTracker = {
- getCurrentBlock: () => '0x11b568',
+ _blockTracker: {
+ getCurrentBlock: () => '0x11b568',
+ },
}
return new NonceTracker({
provider,
- blockTracker,
getPendingTransactions,
getConfirmedTransactions,
})