aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/test/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-06 05:45:35 +0800
committerFabio Berger <me@fabioberger.com>2017-12-06 05:45:35 +0800
commit038668efdfdd2eac85c30206e17128b0af2b48ce (patch)
treedd89073024f6fc89ac6306629d4bd14cd1ac5e5e /packages/subproviders/test/utils
parent47789d770d08c20f33dbd839fcbd7bfa23d252a3 (diff)
downloaddexon-0x-contracts-038668efdfdd2eac85c30206e17128b0af2b48ce.tar.gz
dexon-0x-contracts-038668efdfdd2eac85c30206e17128b0af2b48ce.tar.zst
dexon-0x-contracts-038668efdfdd2eac85c30206e17128b0af2b48ce.zip
Port subproviders over to mono repo, refactor LedgerSubprovider to no longer rely on hookedWalletSubprovider. Added unit and integration tests.
Diffstat (limited to 'packages/subproviders/test/utils')
-rw-r--r--packages/subproviders/test/utils/report_callback_errors.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/subproviders/test/utils/report_callback_errors.ts b/packages/subproviders/test/utils/report_callback_errors.ts
new file mode 100644
index 000000000..8a8f4d966
--- /dev/null
+++ b/packages/subproviders/test/utils/report_callback_errors.ts
@@ -0,0 +1,14 @@
+import { DoneCallback } from '../../src/types';
+
+export const reportCallbackErrors = (done: DoneCallback) => {
+ return (f: (...args: any[]) => void) => {
+ const wrapped = async (...args: any[]) => {
+ try {
+ f(...args);
+ } catch (err) {
+ done(err);
+ }
+ };
+ return wrapped;
+ };
+};