From 613fada49f9d168fb949a370b884367f99deb401 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:15:14 +0100 Subject: Add etherToken.getLogsAsync and etherToken.subscribe with tests --- packages/0x.js/src/0x.ts | 2 +- .../src/contract_wrappers/ether_token_wrapper.ts | 74 +++++++++++++++++++++- packages/0x.js/src/index.ts | 2 + packages/0x.js/src/types.ts | 21 +++++- 4 files changed, 93 insertions(+), 6 deletions(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index e4965f9a2..7393cc814 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -201,7 +201,7 @@ export class ZeroEx { this._web3Wrapper, config.networkId, config.tokenRegistryContractAddress, ); this.etherToken = new EtherTokenWrapper( - this._web3Wrapper, config.networkId, this.token, + this._web3Wrapper, config.networkId, this._abiDecoder, this.token, ); this.orderStateWatcher = new OrderStateWatcher( this._web3Wrapper, this._abiDecoder, this.token, this.exchange, config.orderWatcherConfig, diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index a6acbe45d..7b5b4d02a 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -1,9 +1,21 @@ +import {schemas} from '@0xproject/json-schemas'; import {Web3Wrapper} from '@0xproject/web3-wrapper'; import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; import {artifacts} from '../artifacts'; -import {TransactionOpts, ZeroExError} from '../types'; +import { + BlockRange, + EtherTokenContractEventArgs, + EtherTokenEvents, + EventCallback, + IndexedFilterValues, + LogWithDecodedArgs, + TokenEvents, + TransactionOpts, + ZeroExError, +} from '../types'; +import {AbiDecoder} from '../utils/abi_decoder'; import {assert} from '../utils/assert'; import {ContractWrapper} from './contract_wrapper'; @@ -17,8 +29,8 @@ import {TokenWrapper} from './token_wrapper'; export class EtherTokenWrapper extends ContractWrapper { private _etherTokenContractIfExists?: EtherTokenContract; private _tokenWrapper: TokenWrapper; - constructor(web3Wrapper: Web3Wrapper, networkId: number, tokenWrapper: TokenWrapper) { - super(web3Wrapper, networkId); + constructor(web3Wrapper: Web3Wrapper, networkId: number, abiDecoder: AbiDecoder, tokenWrapper: TokenWrapper) { + super(web3Wrapper, networkId, abiDecoder); this._tokenWrapper = tokenWrapper; } /** @@ -75,7 +87,63 @@ export class EtherTokenWrapper extends ContractWrapper { }); return txHash; } + /** + * Gets historical logs without creating a subscription + * @param etherTokenAddress An address of the ether token that emmited the logs. + * @param eventName The ether token contract event you would like to subscribe to. + * @param blockRange Block range to get logs from. + * @param indexFilterValues An object where the keys are indexed args returned by the event and + * the value is the value you are interested in. E.g `{_owner: aUserAddressHex}` + * @return Array of logs that match the parameters + */ + public async getLogsAsync( + etherTokenAddress: string, eventName: EtherTokenEvents, blockRange: BlockRange, + indexFilterValues: IndexedFilterValues): Promise>> { + assert.isETHAddressHex('etherTokenAddress', etherTokenAddress); + assert.doesBelongToStringEnum('eventName', eventName, TokenEvents); + assert.doesConformToSchema('blockRange', blockRange, schemas.blockRangeSchema); + assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema); + const logs = await this._getLogsAsync( + etherTokenAddress, eventName, blockRange, indexFilterValues, artifacts.TokenArtifact.abi, + ); + return logs; + } + /** + * Subscribe to an event type emitted by the Token contract. + * @param etherTokenAddress The hex encoded address where the ether token is deployed. + * @param eventName The ether token contract event you would like to subscribe to. + * @param indexFilterValues An object where the keys are indexed args returned by the event and + * the value is the value you are interested in. E.g `{_owner: aUserAddressHex}` + * @param callback Callback that gets called when a log is added/removed + * @return Subscription token used later to unsubscribe + */ + public subscribe( + etherTokenAddress: string, eventName: EtherTokenEvents, indexFilterValues: IndexedFilterValues, + callback: EventCallback): string { + assert.isETHAddressHex('etherTokenAddress', etherTokenAddress); + assert.doesBelongToStringEnum('eventName', eventName, TokenEvents); + assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema); + assert.isFunction('callback', callback); + const subscriptionToken = this._subscribe( + etherTokenAddress, eventName, indexFilterValues, artifacts.TokenArtifact.abi, callback, + ); + return subscriptionToken; + } + /** + * Cancel a subscription + * @param subscriptionToken Subscription token returned by `subscribe()` + */ + public unsubscribe(subscriptionToken: string): void { + this._unsubscribe(subscriptionToken); + } + /** + * Cancels all existing subscriptions + */ + public unsubscribeAll(): void { + super.unsubscribeAll(); + } private _invalidateContractInstance(): void { + this.unsubscribeAll(); delete this._etherTokenContractIfExists; } private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise { diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts index b75ca4fa3..b43e7f33f 100644 --- a/packages/0x.js/src/index.ts +++ b/packages/0x.js/src/index.ts @@ -2,6 +2,7 @@ export {ZeroEx} from './0x'; export { Order, + BlockParamLiteral, SignedOrder, ECSignature, ZeroExError, @@ -27,6 +28,7 @@ export { ContractEventArg, Web3Provider, ZeroExConfig, + EtherTokenEvents, TransactionReceiptWithDecodedLogs, LogWithDecodedArgs, MethodOpts, diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index 704e59ce5..e6a2c05d0 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -28,6 +28,7 @@ export enum ZeroExError { export enum InternalZeroExError { NoAbiDecoder = 'NO_ABI_DECODER', ZrxNotInTokenRegistry = 'ZRX_NOT_IN_TOKEN_REGISTRY', + WethNotInTokenRegistry = 'WETH_NOT_IN_TOKEN_REGISTRY', } /** @@ -146,8 +147,17 @@ export interface ApprovalContractEventArgs { _spender: string; _value: BigNumber; } +export interface DepositContractEventArgs { + _owner: string; + _value: BigNumber; +} +export interface WithdrawalContractEventArgs { + _owner: string; + _value: BigNumber; +} export type TokenContractEventArgs = TransferContractEventArgs|ApprovalContractEventArgs; -export type ContractEventArgs = ExchangeContractEventArgs|TokenContractEventArgs; +export type EtherTokenContractEventArgs = TokenContractEventArgs|DepositContractEventArgs|WithdrawalContractEventArgs; +export type ContractEventArgs = ExchangeContractEventArgs|TokenContractEventArgs|EtherTokenContractEventArgs; export type ContractEventArg = string|BigNumber; export interface Order { @@ -201,7 +211,14 @@ export enum TokenEvents { Approval = 'Approval', } -export type ContractEvents = TokenEvents|ExchangeEvents; +export enum EtherTokenEvents { + Transfer = 'Transfer', + Approval = 'Approval', + Deposit = 'Deposit', + Withdrawal = 'Withdrawal', +} + +export type ContractEvents = TokenEvents|ExchangeEvents|EtherTokenEvents; export interface IndexedFilterValues { [index: string]: ContractEventArg; -- cgit v1.2.3 From 0056c66d324ca4d8cee82a84ff64b4832ea360f9 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:22:40 +0100 Subject: Enable multiple EtherTokenContract instances --- packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index 7b5b4d02a..1edc50cb0 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -27,7 +27,7 @@ import {TokenWrapper} from './token_wrapper'; * The caller can convert ETH into the equivalent number of wrapped ETH ERC20 tokens and back. */ export class EtherTokenWrapper extends ContractWrapper { - private _etherTokenContractIfExists?: EtherTokenContract; + private _etherTokenContractsByAddress: {[address: string]: EtherTokenContract}; private _tokenWrapper: TokenWrapper; constructor(web3Wrapper: Web3Wrapper, networkId: number, abiDecoder: AbiDecoder, tokenWrapper: TokenWrapper) { super(web3Wrapper, networkId, abiDecoder); @@ -144,14 +144,19 @@ export class EtherTokenWrapper extends ContractWrapper { } private _invalidateContractInstance(): void { this.unsubscribeAll(); - delete this._etherTokenContractIfExists; + this._etherTokenContractsByAddress = {}; } private async _getEtherTokenContractAsync(etherTokenAddress: string): Promise { + let etherTokenContract = this._etherTokenContractsByAddress[etherTokenAddress]; + if (!_.isUndefined(etherTokenContract)) { + return etherTokenContract; + } const web3ContractInstance = await this._instantiateContractIfExistsAsync( artifacts.EtherTokenArtifact, etherTokenAddress, ); const contractInstance = new EtherTokenContract(web3ContractInstance, this._web3Wrapper.getContractDefaults()); - this._etherTokenContractIfExists = contractInstance; - return this._etherTokenContractIfExists; + etherTokenContract = contractInstance; + this._etherTokenContractsByAddress[etherTokenAddress] = etherTokenContract; + return etherTokenContract; } } -- cgit v1.2.3 From e92d6ff84f781005eb01cc5e82eed29a244c9ee8 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:27:48 +0100 Subject: Add EtherToken events to the ABI --- packages/0x.js/src/artifacts/EtherToken.json | 34 ++++++++++++++++++++++ .../src/contract_wrappers/ether_token_wrapper.ts | 4 +-- 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/artifacts/EtherToken.json b/packages/0x.js/src/artifacts/EtherToken.json index de6946cf2..0a6c5644c 100644 --- a/packages/0x.js/src/artifacts/EtherToken.json +++ b/packages/0x.js/src/artifacts/EtherToken.json @@ -231,6 +231,40 @@ ], "name": "Approval", "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_owner", + "type": "address" + }, + { + "indexed": false, + "name": "_value", + "type": "uint" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "_owner", + "type": "address" + }, + { + "indexed": false, + "name": "_value", + "type": "uint" + } + ], + "name": "Withdrawal", + "type": "event" } ], "networks": { diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index 1edc50cb0..b1d5a0ccc 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -104,7 +104,7 @@ export class EtherTokenWrapper extends ContractWrapper { assert.doesConformToSchema('blockRange', blockRange, schemas.blockRangeSchema); assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema); const logs = await this._getLogsAsync( - etherTokenAddress, eventName, blockRange, indexFilterValues, artifacts.TokenArtifact.abi, + etherTokenAddress, eventName, blockRange, indexFilterValues, artifacts.EtherTokenArtifact.abi, ); return logs; } @@ -125,7 +125,7 @@ export class EtherTokenWrapper extends ContractWrapper { assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema); assert.isFunction('callback', callback); const subscriptionToken = this._subscribe( - etherTokenAddress, eventName, indexFilterValues, artifacts.TokenArtifact.abi, callback, + etherTokenAddress, eventName, indexFilterValues, artifacts.EtherTokenArtifact.abi, callback, ); return subscriptionToken; } -- cgit v1.2.3 From b829d55752416c60440c6ed91b1f59b753416634 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:30:37 +0100 Subject: Make order watcher react to new etherToken events --- .../0x.js/src/order_watcher/order_state_watcher.ts | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts index c4a9eb1ad..af9814dc8 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -12,6 +12,8 @@ import { ApprovalContractEventArgs, BlockParamLiteral, ContractEventArgs, + DepositContractEventArgs, + EtherTokenEvents, ExchangeContractErrs, ExchangeEvents, LogCancelContractEventArgs, @@ -24,6 +26,7 @@ import { SignedOrder, TokenEvents, TransferContractEventArgs, + WithdrawalContractEventArgs, ZeroExError, } from '../types'; import {AbiDecoder} from '../utils/abi_decoder'; @@ -243,6 +246,36 @@ export class OrderStateWatcher { } break; } + case EtherTokenEvents.Deposit: + { + // Invalidate cache + const args = decodedLog.args as DepositContractEventArgs; + this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner); + // Revalidate orders + makerToken = decodedLog.address; + makerAddress = args._owner; + if (!_.isUndefined(this._dependentOrderHashes[makerAddress]) && + !_.isUndefined(this._dependentOrderHashes[makerAddress][makerToken])) { + const orderHashes = Array.from(this._dependentOrderHashes[makerAddress][makerToken]); + await this._emitRevalidateOrdersAsync(orderHashes); + } + break; + } + case EtherTokenEvents.Withdrawal: + { + // Invalidate cache + const args = decodedLog.args as WithdrawalContractEventArgs; + this._balanceAndProxyAllowanceLazyStore.deleteBalance(decodedLog.address, args._owner); + // Revalidate orders + makerToken = decodedLog.address; + makerAddress = args._owner; + if (!_.isUndefined(this._dependentOrderHashes[makerAddress]) && + !_.isUndefined(this._dependentOrderHashes[makerAddress][makerToken])) { + const orderHashes = Array.from(this._dependentOrderHashes[makerAddress][makerToken]); + await this._emitRevalidateOrdersAsync(orderHashes); + } + break; + } case ExchangeEvents.LogFill: { // Invalidate cache -- cgit v1.2.3 From 9594185f113c09736528dd8b8064c3f45a982cc3 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:37:42 +0100 Subject: Export new public types --- packages/0x.js/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts index b43e7f33f..da06aad34 100644 --- a/packages/0x.js/src/index.ts +++ b/packages/0x.js/src/index.ts @@ -24,6 +24,9 @@ export { TransferContractEventArgs, ApprovalContractEventArgs, TokenContractEventArgs, + EtherTokenContractEventArgs, + WithdrawalContractEventArgs, + DepositContractEventArgs, ContractEventArgs, ContractEventArg, Web3Provider, -- cgit v1.2.3 From abce410897c5b90cd70b258a5231c99817bec9c1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:44:56 +0100 Subject: Init the _etherTokenContractsByAddress --- packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index b1d5a0ccc..238009759 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -27,7 +27,7 @@ import {TokenWrapper} from './token_wrapper'; * The caller can convert ETH into the equivalent number of wrapped ETH ERC20 tokens and back. */ export class EtherTokenWrapper extends ContractWrapper { - private _etherTokenContractsByAddress: {[address: string]: EtherTokenContract}; + private _etherTokenContractsByAddress: {[address: string]: EtherTokenContract} = {}; private _tokenWrapper: TokenWrapper; constructor(web3Wrapper: Web3Wrapper, networkId: number, abiDecoder: AbiDecoder, tokenWrapper: TokenWrapper) { super(web3Wrapper, networkId, abiDecoder); -- cgit v1.2.3 From c07de97fd8a0fe3cf3ea15b2b6a02b326875e6de Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 20 Dec 2017 13:20:24 +0100 Subject: Fix WETH events watching --- packages/0x.js/src/artifacts/EtherToken.json | 4 ++-- packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/artifacts/EtherToken.json b/packages/0x.js/src/artifacts/EtherToken.json index 0a6c5644c..b28a463c0 100644 --- a/packages/0x.js/src/artifacts/EtherToken.json +++ b/packages/0x.js/src/artifacts/EtherToken.json @@ -243,7 +243,7 @@ { "indexed": false, "name": "_value", - "type": "uint" + "type": "uint256" } ], "name": "Deposit", @@ -260,7 +260,7 @@ { "indexed": false, "name": "_value", - "type": "uint" + "type": "uint256" } ], "name": "Withdrawal", diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index 238009759..7b2743811 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -100,7 +100,7 @@ export class EtherTokenWrapper extends ContractWrapper { etherTokenAddress: string, eventName: EtherTokenEvents, blockRange: BlockRange, indexFilterValues: IndexedFilterValues): Promise>> { assert.isETHAddressHex('etherTokenAddress', etherTokenAddress); - assert.doesBelongToStringEnum('eventName', eventName, TokenEvents); + assert.doesBelongToStringEnum('eventName', eventName, EtherTokenEvents); assert.doesConformToSchema('blockRange', blockRange, schemas.blockRangeSchema); assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema); const logs = await this._getLogsAsync( -- cgit v1.2.3 From b1f36a9024700ab948f7bd75eff24b29032e5907 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 20 Dec 2017 14:01:14 +0100 Subject: Use the new snapshot including WETH9 and it's artifacts --- packages/0x.js/src/artifacts/EtherToken.json | 6 +++--- packages/0x.js/src/artifacts/Exchange.json | 2 +- packages/0x.js/src/artifacts/TokenRegistry.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/artifacts/EtherToken.json b/packages/0x.js/src/artifacts/EtherToken.json index b28a463c0..8eb4d250f 100644 --- a/packages/0x.js/src/artifacts/EtherToken.json +++ b/packages/0x.js/src/artifacts/EtherToken.json @@ -269,16 +269,16 @@ ], "networks": { "1": { - "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070" + "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }, "3": { "address": "0xc00fd9820cd2898cc4c054b7bf142de637ad129a" }, "42": { - "address": "0x05d090b51c40b020eab3bfcb6a2dff130df22e9c" + "address": "0x653e49e301e508a13237c0ddc98ae7d4cd2667a1" }, "50": { - "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c" + "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082" } } } diff --git a/packages/0x.js/src/artifacts/Exchange.json b/packages/0x.js/src/artifacts/Exchange.json index cf9124ca7..fa16637af 100644 --- a/packages/0x.js/src/artifacts/Exchange.json +++ b/packages/0x.js/src/artifacts/Exchange.json @@ -601,7 +601,7 @@ "address": "0x90fe2af704b34e0224bf2299c838e04d4dcf1364" }, "50": { - "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788" + "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064" } } } diff --git a/packages/0x.js/src/artifacts/TokenRegistry.json b/packages/0x.js/src/artifacts/TokenRegistry.json index 973a101e8..c15729dbc 100644 --- a/packages/0x.js/src/artifacts/TokenRegistry.json +++ b/packages/0x.js/src/artifacts/TokenRegistry.json @@ -538,7 +538,7 @@ "address": "0xf18e504561f4347bea557f3d4558f559dddbae7f" }, "50": { - "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082" + "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788" } } } -- cgit v1.2.3 From d639a22cffebed137d703ad76b30f5bcb42de9a4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 20 Dec 2017 14:01:35 +0100 Subject: Add WETH9 tests --- packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index 7b2743811..3e5be3ae4 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -121,7 +121,7 @@ export class EtherTokenWrapper extends ContractWrapper { etherTokenAddress: string, eventName: EtherTokenEvents, indexFilterValues: IndexedFilterValues, callback: EventCallback): string { assert.isETHAddressHex('etherTokenAddress', etherTokenAddress); - assert.doesBelongToStringEnum('eventName', eventName, TokenEvents); + assert.doesBelongToStringEnum('eventName', eventName, EtherTokenEvents); assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema); assert.isFunction('callback', callback); const subscriptionToken = this._subscribe( -- cgit v1.2.3 From 03fd73fab8b26fd3551b610f8bbc63bbcf81a230 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 20 Dec 2017 15:00:25 +0100 Subject: Update snapshot and artifacts --- packages/0x.js/src/artifacts/EtherToken.json | 2 +- packages/0x.js/src/artifacts/Exchange.json | 2 +- packages/0x.js/src/artifacts/TokenRegistry.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/artifacts/EtherToken.json b/packages/0x.js/src/artifacts/EtherToken.json index 8eb4d250f..1105af3b0 100644 --- a/packages/0x.js/src/artifacts/EtherToken.json +++ b/packages/0x.js/src/artifacts/EtherToken.json @@ -278,7 +278,7 @@ "address": "0x653e49e301e508a13237c0ddc98ae7d4cd2667a1" }, "50": { - "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082" + "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c" } } } diff --git a/packages/0x.js/src/artifacts/Exchange.json b/packages/0x.js/src/artifacts/Exchange.json index fa16637af..cf9124ca7 100644 --- a/packages/0x.js/src/artifacts/Exchange.json +++ b/packages/0x.js/src/artifacts/Exchange.json @@ -601,7 +601,7 @@ "address": "0x90fe2af704b34e0224bf2299c838e04d4dcf1364" }, "50": { - "address": "0x34d402f14d58e001d8efbe6585051bf9706aa064" + "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788" } } } diff --git a/packages/0x.js/src/artifacts/TokenRegistry.json b/packages/0x.js/src/artifacts/TokenRegistry.json index c15729dbc..973a101e8 100644 --- a/packages/0x.js/src/artifacts/TokenRegistry.json +++ b/packages/0x.js/src/artifacts/TokenRegistry.json @@ -538,7 +538,7 @@ "address": "0xf18e504561f4347bea557f3d4558f559dddbae7f" }, "50": { - "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788" + "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082" } } } -- cgit v1.2.3 From 3e3587c2811ed2078aa821490f446c24c9ab5eec Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 20 Dec 2017 15:21:36 +0100 Subject: Fix linter issue --- packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/0x.js/src') diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts index 3e5be3ae4..969f30463 100644 --- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts @@ -11,7 +11,6 @@ import { EventCallback, IndexedFilterValues, LogWithDecodedArgs, - TokenEvents, TransactionOpts, ZeroExError, } from '../types'; -- cgit v1.2.3