aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-13 09:49:48 +0800
committerFabio Berger <me@fabioberger.com>2017-11-13 09:49:48 +0800
commit442f35a1fdd98846d3985548b3de6f5c620e68a1 (patch)
treee498559ce452a0d1eddfc4df6224450492efa892 /src/contract_wrappers/exchange_wrapper.ts
parent6becf22a2f752ef7c34ce1b423efd51773cc5fde (diff)
parent1392a855bb17981f7680548a23062842fb6dc4e0 (diff)
downloaddexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar
dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.gz
dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.bz2
dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.lz
dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.xz
dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.tar.zst
dexon-sol-tools-442f35a1fdd98846d3985548b3de6f5c620e68a1.zip
Merge branch 'development' into orderWatcher
* development: 0.23.0 Update CHANGELOG Fix amounts in tests one last time. Now that we updated the testRPC snapshot, this should no longer be mismatched between CI and locally Update testRPC snapshot used by CircleCi Push unsubscribe to the base class rather than super Check for null rather than undefined Removed nits Test case was error then unsubscribe Clean up subscription state. Fix unhandled promise rejection error on subscriptions # Conflicts: # src/types.ts # test/exchange_wrapper_test.ts # test/token_wrapper_test.ts
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index f68e80b5d..fe0c5bc00 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -48,7 +48,6 @@ const SHOULD_VALIDATE_BY_DEFAULT = true;
*/
export class ExchangeWrapper extends ContractWrapper {
private _exchangeContractIfExists?: ExchangeContract;
- private _activeSubscriptions: string[];
private _orderValidationUtils: OrderValidationUtils;
private _tokenWrapper: TokenWrapper;
private _exchangeContractErrCodesToMsg = {
@@ -83,7 +82,6 @@ export class ExchangeWrapper extends ContractWrapper {
super(web3Wrapper, abiDecoder);
this._tokenWrapper = tokenWrapper;
this._orderValidationUtils = new OrderValidationUtils(tokenWrapper, this);
- this._activeSubscriptions = [];
this._contractAddressIfExists = contractAddressIfExists;
}
/**
@@ -665,7 +663,6 @@ export class ExchangeWrapper extends ContractWrapper {
const subscriptionToken = this._subscribe<ArgsType>(
exchangeContractAddress, eventName, indexFilterValues, artifacts.ExchangeArtifact.abi, callback,
);
- this._activeSubscriptions.push(subscriptionToken);
return subscriptionToken;
}
/**
@@ -673,7 +670,6 @@ export class ExchangeWrapper extends ContractWrapper {
* @param subscriptionToken Subscription token returned by `subscribe()`
*/
public unsubscribe(subscriptionToken: string): void {
- _.pull(this._activeSubscriptions, subscriptionToken);
this._unsubscribe(subscriptionToken);
}
/**
@@ -824,13 +820,6 @@ export class ExchangeWrapper extends ContractWrapper {
const ZRXtokenAddress = await exchangeInstance.ZRX_TOKEN_CONTRACT.callAsync();
return ZRXtokenAddress;
}
- /**
- * Cancels all existing subscriptions
- */
- public unsubscribeAll(): void {
- _.forEach(this._activeSubscriptions, this._unsubscribe.bind(this));
- this._activeSubscriptions = [];
- }
private async _invalidateContractInstancesAsync(): Promise<void> {
this.unsubscribeAll();
delete this._exchangeContractIfExists;