From e798be94aeb02f4b8319ccd09d195ce9fac1c6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Wed, 20 Jul 2022 11:08:57 +0100 Subject: [PATCH] fix: remove coins not supported by ciphertrace --- lib/plugins/wallet/dashd/dashd.js | 5 +---- lib/plugins/wallet/monerod/monerod.js | 6 +----- lib/plugins/wallet/zcashd/zcashd.js | 4 +--- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/plugins/wallet/dashd/dashd.js b/lib/plugins/wallet/dashd/dashd.js index 9b84a6a0..57a58ae3 100644 --- a/lib/plugins/wallet/dashd/dashd.js +++ b/lib/plugins/wallet/dashd/dashd.js @@ -126,10 +126,7 @@ function checkBlockchainStatus (cryptoCode) { } function getTxHashesByAddress (cryptoCode, address) { - checkCryptoCode(cryptoCode) - .then(() => fetch('listreceivedbyaddress', [0, true, true, true, address])) - .then(txsByAddress => Promise.all(_.forEach(id => fetch('getrawtransaction', [id]), _.head(txsByAddress).txids))) - .then(_.map(({ hash }) => hash)) + throw new Error(`Transactions hash retrieval is not implemented for this coin!`) } module.exports = { diff --git a/lib/plugins/wallet/monerod/monerod.js b/lib/plugins/wallet/monerod/monerod.js index 1ed93bf8..50e45ba1 100644 --- a/lib/plugins/wallet/monerod/monerod.js +++ b/lib/plugins/wallet/monerod/monerod.js @@ -236,11 +236,7 @@ function checkBlockchainStatus (cryptoCode) { } function getTxHashesByAddress (cryptoCode, address) { - checkCryptoCode(cryptoCode) - .then(() => refreshWallet()) - .then(() => fetch('get_address_index', { address: address })) - .then(addressRes => fetch('get_transfers', { in: true, pool: true, pending: true, account_index: addressRes.index.major, address_indices: [addressRes.index.minor] })) - .then(_.map(({ txid }) => txid)) + throw new Error(`Transactions hash retrieval is not implemented for this coin!`) } module.exports = { diff --git a/lib/plugins/wallet/zcashd/zcashd.js b/lib/plugins/wallet/zcashd/zcashd.js index d9d7f867..057cd4a2 100644 --- a/lib/plugins/wallet/zcashd/zcashd.js +++ b/lib/plugins/wallet/zcashd/zcashd.js @@ -152,9 +152,7 @@ function checkBlockchainStatus (cryptoCode) { } function getTxHashesByAddress (cryptoCode, address) { - checkCryptoCode(cryptoCode) - .then(() => fetch('getaddresstxids', [address])) - .then(_.mapKeys(() => 'txid')) + throw new Error(`Transactions hash retrieval is not implemented for this coin!`) } module.exports = {