From 6602421cfea853abf4d723ba9474acce70d4d34a Mon Sep 17 00:00:00 2001 From: Jaco Date: Sat, 19 Nov 2022 13:28:23 +0200 Subject: [PATCH] Cleanup ledger-substrate path imports (#1677) * Cleanup leadger-substrate path imports * Adjust --- packages/hw-ledger/src/bundle.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/hw-ledger/src/bundle.ts b/packages/hw-ledger/src/bundle.ts index 2b9bcb5c6..c6ba8d44c 100644 --- a/packages/hw-ledger/src/bundle.ts +++ b/packages/hw-ledger/src/bundle.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { SubstrateApp } from '@zondax/ledger-substrate'; -import type { ResponseBase } from '@zondax/ledger-substrate/dist/common'; import type { AccountOptions, LedgerAddress, LedgerSignature, LedgerTypes, LedgerVersion } from './types'; import { newSubstrateApp } from '@zondax/ledger-substrate'; @@ -17,8 +16,10 @@ export { packageInfo } from './packageInfo'; type Chain = keyof typeof ledgerApps; -/** @internal */ -async function wrapError (promise: Promise): Promise { +type WrappedResult = Awaited>; + +/** @internal Wraps a SubstrateApp call, checking the result for any errors which result in a rejection */ +async function wrapError (promise: Promise): Promise { const result = await promise; if (result.return_code !== LEDGER_SUCCESS_CODE) {