From 93321f06fbbf2c8a386f3375cb869e6bc7c6b757 Mon Sep 17 00:00:00 2001 From: Gabriele Genta Date: Sat, 17 Jul 2021 22:37:06 +0200 Subject: [PATCH] FIX: typescript compilation errors --- BlueApp.js | 2 +- __mocks__/@react-native-async-storage/async-storage.js | 4 +++- blue_modules/ur/index.js | 2 +- class/wallets/hd-aezeed-wallet.js | 2 +- screen/send/confirm.js | 2 +- screen/wallets/viewEditMultisigCosigners.js | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/BlueApp.js b/BlueApp.js index e167e00f1..c19875c33 100644 --- a/BlueApp.js +++ b/BlueApp.js @@ -5,7 +5,7 @@ import loc from './loc'; const prompt = require('./blue_modules/prompt'); const currency = require('./blue_modules/currency'); const BlueElectrum = require('./blue_modules/BlueElectrum'); // eslint-disable-line no-unused-vars -const BlueApp: AppStorage = new AppStorage(); +const BlueApp = new AppStorage(); // If attempt reaches 10, a wipe keychain option will be provided to the user. let unlockAttempt = 0; diff --git a/__mocks__/@react-native-async-storage/async-storage.js b/__mocks__/@react-native-async-storage/async-storage.js index 32e39bc7a..ef43ca918 100644 --- a/__mocks__/@react-native-async-storage/async-storage.js +++ b/__mocks__/@react-native-async-storage/async-storage.js @@ -1 +1,3 @@ -export default from '@react-native-async-storage/async-storage/jest/async-storage-mock' +import AsyncStorageMock from '@react-native-async-storage/async-storage/jest/async-storage-mock'; + +export default AsyncStorageMock; diff --git a/blue_modules/ur/index.js b/blue_modules/ur/index.js index 28b73a626..4bf6aff12 100644 --- a/blue_modules/ur/index.js +++ b/blue_modules/ur/index.js @@ -9,7 +9,7 @@ import { CryptoPSBT, CryptoAccount, Bytes, -} from '@keystonehq/bc-ur-registry'; +} from '@keystonehq/bc-ur-registry/dist'; import { decodeUR as origDecodeUr, encodeUR as origEncodeUR, extractSingleWorkload as origExtractSingleWorkload } from '../bc-ur/dist'; import { MultisigCosigner, MultisigHDWallet } from '../../class'; import { Psbt } from 'bitcoinjs-lib'; diff --git a/class/wallets/hd-aezeed-wallet.js b/class/wallets/hd-aezeed-wallet.js index 36aae589b..ac0be902c 100644 --- a/class/wallets/hd-aezeed-wallet.js +++ b/class/wallets/hd-aezeed-wallet.js @@ -51,7 +51,7 @@ export class HDAezeedWallet extends AbstractHDElectrumWallet { return this._xpub; } - validateMnemonic(): boolean { + validateMnemonic() { throw new Error('Use validateMnemonicAsync()'); } diff --git a/screen/send/confirm.js b/screen/send/confirm.js index a2eb59595..33e183b9a 100644 --- a/screen/send/confirm.js +++ b/screen/send/confirm.js @@ -76,7 +76,7 @@ export default class Confirm extends Component { const payjoinUrl = this.state.payjoinUrl; // working through TOR - crafting custom requester that will handle TOR http request const customPayjoinRequester = { - requestPayjoin: async function (psbt: Psbt) { + requestPayjoin: async function (psbt) { console.warn('requesting payjoin with psbt:', psbt.toBase64()); const api = new torrific.Torsbee(); const torResponse = await api.post(payjoinUrl, { diff --git a/screen/wallets/viewEditMultisigCosigners.js b/screen/wallets/viewEditMultisigCosigners.js index 1b6e0a59e..739ac1b06 100644 --- a/screen/wallets/viewEditMultisigCosigners.js +++ b/screen/wallets/viewEditMultisigCosigners.js @@ -55,7 +55,7 @@ const ViewEditMultisigCosigners = () => { const { walletId } = route.params; const w = useRef(wallets.find(wallet => wallet.getID() === walletId)); const tempWallet = useRef(new MultisigHDWallet()); - const [wallet: MultisigHDWallet, setWallet] = useState(); + const [wallet, setWallet] = useState(); const [isLoading, setIsLoading] = useState(true); const [isSaveButtonDisabled, setIsSaveButtonDisabled] = useState(true); const [currentlyEditingCosignerNum, setCurrentlyEditingCosignerNum] = useState(false);