assert instead of if

This commit is contained in:
Lex Berezhny 2018-11-28 17:09:31 -05:00
parent 7e39b0c4fe
commit dc2786fbc0

View file

@ -334,10 +334,8 @@ class LbryWalletManager(BaseWalletManager):
if other_txo.is_claim and other_txo.claim_id == txo.claim_id: if other_txo.is_claim and other_txo.claim_id == txo.claim_id:
previous = other_txo previous = other_txo
break break
if previous is None: assert previous is not None,\
raise ValueError( "Invalid claim update state, expected to find previous claim in input."
"Invalid claim update state, expected to find previous claim in input."
)
item['update_info'].append({ item['update_info'].append({
'address': txo.get_address(account.ledger), 'address': txo.get_address(account.ledger),
'balance_delta': dewies_to_lbc(previous.amount-txo.amount), 'balance_delta': dewies_to_lbc(previous.amount-txo.amount),