From fcd37808d46d162b183b7c6d9aeb58ebc431caba Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 23 Nov 2017 15:12:15 -0600 Subject: Rename removed to isRemoved --- packages/0x.js/src/contract_wrappers/contract_wrapper.ts | 12 ++++++------ packages/0x.js/src/types.ts | 2 +- packages/0x.js/test/token_wrapper_test.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'packages') diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts index 70548293c..c1c95c6db 100644 --- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts @@ -95,13 +95,13 @@ export class ContractWrapper { await this._web3Wrapper.getContractInstanceFromArtifactAsync(artifact, addressIfExists); return contractInstance; } - private _onLogStateChanged(removed: boolean, log: Web3.LogEntry): void { + private _onLogStateChanged(isRemoved: boolean, log: Web3.LogEntry): void { _.forEach(this._filters, (filter: Web3.FilterObject, filterToken: string) => { if (filterUtils.matchesFilter(log, filter)) { const decodedLog = this._tryToDecodeLogOrNoop(log) as LogWithDecodedArgs; const logEvent = { log: decodedLog, - removed, + isRemoved, }; this._filterCallbacks[filterToken](null, logEvent); } @@ -117,13 +117,13 @@ export class ContractWrapper { this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval( this._reconcileBlockAsync.bind(this), constants.DEFAULT_BLOCK_POLLING_INTERVAL, ); - let removed = false; + let isRemoved = false; this._onLogAddedSubscriptionToken = this._blockAndLogStreamer.subscribeToOnLogAdded( - this._onLogStateChanged.bind(this, removed), + this._onLogStateChanged.bind(this, isRemoved), ); - removed = true; + isRemoved = true; this._onLogRemovedSubscriptionToken = this._blockAndLogStreamer.subscribeToOnLogRemoved( - this._onLogStateChanged.bind(this, removed), + this._onLogStateChanged.bind(this, isRemoved), ); } private _stopBlockAndLogStream(): void { diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index d94868d9f..ac4106d0b 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -41,7 +41,7 @@ export type OrderValues = [BigNumber, BigNumber, BigNumber, export type LogEvent = Web3.LogEntryEvent; export interface DecodedLogEvent { - removed: boolean; + isRemoved: boolean; log: LogWithDecodedArgs; } diff --git a/packages/0x.js/test/token_wrapper_test.ts b/packages/0x.js/test/token_wrapper_test.ts index d44bf603c..882913793 100644 --- a/packages/0x.js/test/token_wrapper_test.ts +++ b/packages/0x.js/test/token_wrapper_test.ts @@ -361,7 +361,7 @@ describe('TokenWrapper', () => { (async () => { const callback = (err: Error, logEvent: DecodedLogEvent) => { expect(logEvent).to.not.be.undefined(); - expect(logEvent.removed).to.be.false(); + expect(logEvent.isRemoved).to.be.false(); expect(logEvent.log.logIndex).to.be.equal(0); expect(logEvent.log.transactionIndex).to.be.equal(0); expect(logEvent.log.blockNumber).to.be.a('number'); @@ -380,7 +380,7 @@ describe('TokenWrapper', () => { (async () => { const callback = (err: Error, logEvent: DecodedLogEvent) => { expect(logEvent).to.not.be.undefined(); - expect(logEvent.removed).to.be.false(); + expect(logEvent.isRemoved).to.be.false(); const args = logEvent.log.args; expect(args._owner).to.be.equal(coinbase); expect(args._spender).to.be.equal(addressWithoutFunds); -- cgit