From 9c13030a15cb5ad0492a7ec111fcafce70798bd5 Mon Sep 17 00:00:00 2001 From: Brannon King Date: Tue, 21 Dec 2021 15:25:48 -0500 Subject: [PATCH] get better error on RPC failure --- lbry/wallet/orchstr8/node.py | 7 +++++-- .../integration/transactions/test_transaction_commands.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lbry/wallet/orchstr8/node.py b/lbry/wallet/orchstr8/node.py index b54331f83..5491fd782 100644 --- a/lbry/wallet/orchstr8/node.py +++ b/lbry/wallet/orchstr8/node.py @@ -589,9 +589,12 @@ class LBCWalletNode: *cmnd_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) out, err = await process.communicate() - if err and b'creating a default config file' not in err: - log.warning(err) result = out.decode().strip() + err = err.decode().strip() + if len(result) <= 0 and err.startswith('-'): + raise Exception(err) + if err and 'creating a default config file' not in err: + log.warning(err) self.log.info(result) if result.startswith('error code'): raise Exception(result) diff --git a/tests/integration/transactions/test_transaction_commands.py b/tests/integration/transactions/test_transaction_commands.py index 8d2203cc6..ac3402711 100644 --- a/tests/integration/transactions/test_transaction_commands.py +++ b/tests/integration/transactions/test_transaction_commands.py @@ -50,10 +50,10 @@ class TestSegwit(CommandTestCase): bech32_address3 = await self.blockchain.get_new_address(self.blockchain.BECH32_ADDRESS) # fund specific addresses for later use - p2sh_txid1 = await self.send_to_address_and_wait(p2sh_address1, '1.0') - p2sh_txid2 = await self.send_to_address_and_wait(p2sh_address2, '1.0') - bech32_txid1 = await self.send_to_address_and_wait(bech32_address1, '1.0') - bech32_txid2 = await self.send_to_address_and_wait(bech32_address2, '1.0') + p2sh_txid1 = await self.blockchain.send_to_address(p2sh_address1, '1.0') + p2sh_txid2 = await self.blockchain.send_to_address(p2sh_address2, '1.0') + bech32_txid1 = await self.blockchain.send_to_address(bech32_address1, '1.0') + bech32_txid2 = await self.blockchain.send_to_address(bech32_address2, '1.0') await self.generate(1) # P2SH & BECH32 can pay to P2SH address