aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-14 01:30:01 +0800
committerFabio Berger <me@fabioberger.com>2017-11-14 01:30:01 +0800
commit2060940ecc58fd99f32cf00df7469337f5fc43f0 (patch)
tree2a943702e6f8837590b2b34a3496844d92c4f182 /packages/0x.js
parent70661c179f589c20f893a354c9d66646854f6638 (diff)
downloaddexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.tar
dexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.tar.gz
dexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.tar.bz2
dexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.tar.lz
dexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.tar.xz
dexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.tar.zst
dexon-sol-tools-2060940ecc58fd99f32cf00df7469337f5fc43f0.zip
Fix lint and ts issues
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts2
-rw-r--r--packages/0x.js/test/subscription_test.ts18
2 files changed, 10 insertions, 10 deletions
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index fe0c5bc00..b4bf24846 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -807,7 +807,7 @@ export class ExchangeWrapper extends ContractWrapper {
if (!_.isUndefined(errLog)) {
const logArgs = errLog.args;
const errCode = logArgs.errorId.toNumber();
- const errMessage = this._exchangeContractErrCodesToMsg[errCode];
+ const errMessage: ExchangeContractErrs = this._exchangeContractErrCodesToMsg[errCode];
throw new Error(errMessage);
}
}
diff --git a/packages/0x.js/test/subscription_test.ts b/packages/0x.js/test/subscription_test.ts
index 985fdc1d6..f69ae0b13 100644
--- a/packages/0x.js/test/subscription_test.ts
+++ b/packages/0x.js/test/subscription_test.ts
@@ -13,7 +13,7 @@ import {
Token,
ApprovalContractEventArgs,
TokenEvents,
- LogEvent,
+ DecodedLogEvent,
} from '../src';
import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
import {TokenUtils} from './utils/token_utils';
@@ -64,15 +64,15 @@ describe('SubscriptionTest', () => {
});
it('Should receive the Error when an error occurs', (done: DoneCallback) => {
(async () => {
- const callback = (err: Error, logEvent: LogEvent<ApprovalContractEventArgs>) => {
+ const callback = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => {
expect(err).to.not.be.null();
expect(logEvent).to.be.undefined();
done();
};
stubs = [
Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync')
- .throws("JSON RPC error")
- ]
+ .throws('JSON RPC error'),
+ ];
zeroEx.token.subscribe(
tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
await zeroEx.token.setAllowanceAsync(tokenAddress, coinbase, addressWithoutFunds, allowanceAmount);
@@ -80,16 +80,16 @@ describe('SubscriptionTest', () => {
});
it('Should allow unsubscribeAll to be called successfully after an error', (done: DoneCallback) => {
(async () => {
- const callback = (err: Error, logEvent: LogEvent<ApprovalContractEventArgs>) => { };
+ const callback = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;
zeroEx.token.subscribe(
tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
stubs = [
Sinon.stub((zeroEx as any)._web3Wrapper, 'getBlockAsync')
- .throws("JSON RPC error")
- ]
+ .throws('JSON RPC error'),
+ ];
zeroEx.token.unsubscribeAll();
done();
})().catch(done);
});
- })
- }) \ No newline at end of file
+ });
+});