Skip to content

Commit

Permalink
Merge pull request #2574 from ethereum/issue/2563
Browse files Browse the repository at this point in the history
Dependency handling in SubscriptionsFactory fixed
  • Loading branch information
nivida committed Mar 25, 2019
2 parents f8cb5c6 + 462e972 commit 2be7e5d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @date 2018
*/

import isFunction from 'lodash/isFunction'
import isFunction from 'lodash/isFunction';
import AbstractMethod from '../../../lib/methods/AbstractMethod';

export default class PersonalSignMethod extends AbstractMethod {
Expand Down
7 changes: 1 addition & 6 deletions packages/web3-eth-abi/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

import * as Utils from 'web3-utils';
import {AbiCoder as EthersAbiCoder} from 'ethers/utils/abi-coder';
import isArray from 'lodash/isArray';
import isObject from 'lodash/isObject';
import EthAbiCoder from './AbiCoder.js';

/**
Expand All @@ -34,8 +32,5 @@ import EthAbiCoder from './AbiCoder.js';
* @constructor
*/
export function AbiCoder() {
return new EthAbiCoder(
Utils,
new EthersAbiCoder()
);
return new EthAbiCoder(Utils, new EthersAbiCoder());
}
2 changes: 1 addition & 1 deletion packages/web3-eth/src/factories/SubscriptionsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class SubscriptionsFactory {
this.utils,
this.formatters,
moduleInstance,
new GetPastLogsMethod(this.utils, this.formatters)
new GetPastLogsMethod(this.utils, this.formatters, moduleInstance)
);
case 'newBlockHeaders':
return new NewHeadsSubscription(this.utils, this.formatters, moduleInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ describe('ProvidersModuleFactoryTest', () => {
});

it('createXMLHttpRequest returns instance of XMLHttpRequest', () => {
expect(providersModuleFactory.createXMLHttpRequest('', 0, [{name: 'name', value: 'value'}], {}, true)).toBeInstanceOf(
XHR
);
expect(
providersModuleFactory.createXMLHttpRequest('', 0, [{name: 'name', value: 'value'}], {}, true)
).toBeInstanceOf(XHR);

expect(XHR).toHaveBeenCalledTimes(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ describe('HttpProviderTest', () => {
});

it('constructor check without the property withCredentials in the options', () => {
httpProvider = new HttpProvider(
'http',
{headers: [], timeout: 1},
providersModuleFactoryMock
);
httpProvider = new HttpProvider('http', {headers: [], timeout: 1}, providersModuleFactoryMock);

expect(httpProvider.host).toEqual('http');

Expand Down Expand Up @@ -139,7 +135,7 @@ describe('HttpProviderTest', () => {
httpProvider.timeout,
httpProvider.headers,
httpProvider.agent,
httpProvider.withCredentials,
httpProvider.withCredentials
);

expect(xhrMock.send).toHaveBeenCalledWith('{"id":"0x0"}');
Expand Down

0 comments on commit 2be7e5d

Please sign in to comment.