aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'packages/subproviders/test/unit')
-rw-r--r--packages/subproviders/test/unit/ledger_subprovider_test.ts2
-rw-r--r--packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts24
2 files changed, 13 insertions, 13 deletions
diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts
index edff5144e..a1d146dbc 100644
--- a/packages/subproviders/test/unit/ledger_subprovider_test.ts
+++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts
@@ -55,7 +55,7 @@ describe('LedgerSubprovider', () => {
return ecSignature;
},
transport: {
- close: _.noop,
+ close: _.noop.bind(_),
} as LedgerCommunicationClient,
};
// tslint:enable:no-object-literal-type-assertion
diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
index c437d0815..05f213cf5 100644
--- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
+++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts
@@ -60,9 +60,9 @@ describe('NonceTrackerSubprovider', () => {
const payload = { ...getTransactionCountPayload, params: ['0x0', 'pending'] };
- const response = await promisify<any>(provider.sendAsync, provider)(payload);
+ const response = await promisify<any>(provider.sendAsync.bind(provider))(payload);
expect(response.result).to.be.eq('0x00');
- const secondResponse = await promisify<any>(provider.sendAsync, provider)(payload);
+ const secondResponse = await promisify<any>(provider.sendAsync.bind(provider))(payload);
expect(secondResponse.result).to.be.eq('0x00');
});
it('does not cache the result for latest transaction count', async () => {
@@ -74,9 +74,9 @@ describe('NonceTrackerSubprovider', () => {
const payload = { ...getTransactionCountPayload, params: ['0x0', 'latest'] };
- const response = await promisify<any>(provider.sendAsync, provider)(payload);
+ const response = await promisify<any>(provider.sendAsync.bind(provider))(payload);
expect(response.result).to.be.eq('0x00');
- const secondResponse = await promisify<any>(provider.sendAsync, provider)(payload);
+ const secondResponse = await promisify<any>(provider.sendAsync.bind(provider))(payload);
expect(secondResponse.result).to.be.eq('0x99');
});
it('clears the cache on a Nonce Too Low Error', async () => {
@@ -103,14 +103,14 @@ describe('NonceTrackerSubprovider', () => {
params: [transaction.serialize()],
};
- const response = await promisify<any>(provider.sendAsync, provider)(noncePayload);
+ const response = await promisify<any>(provider.sendAsync.bind(provider))(noncePayload);
expect(response.result).to.be.eq('0x00');
- const secondResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload);
+ const secondResponse = await promisify<any>(provider.sendAsync.bind(provider))(noncePayload);
expect(secondResponse.result).to.be.eq('0x00');
try {
- await promisify(provider.sendAsync, provider)(txPayload);
+ await promisify(provider.sendAsync.bind(provider))(txPayload);
} catch (err) {
- const thirdResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload);
+ const thirdResponse = await promisify<any>(provider.sendAsync.bind(provider))(noncePayload);
expect(thirdResponse.result).to.be.eq('0x99');
}
});
@@ -138,12 +138,12 @@ describe('NonceTrackerSubprovider', () => {
params: [transaction.serialize()],
};
- const response = await promisify<any>(provider.sendAsync, provider)(noncePayload);
+ const response = await promisify<any>(provider.sendAsync.bind(provider))(noncePayload);
expect(response.result).to.be.eq('0x00');
- const secondResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload);
+ const secondResponse = await promisify<any>(provider.sendAsync.bind(provider))(noncePayload);
expect(secondResponse.result).to.be.eq('0x00');
- await promisify(provider.sendAsync, provider)(txPayload);
- const thirdResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload);
+ await promisify(provider.sendAsync.bind(provider))(txPayload);
+ const thirdResponse = await promisify<any>(provider.sendAsync.bind(provider))(noncePayload);
expect(thirdResponse.result).to.be.eq('0x01');
});
});