[Cashtab] Do not throw API error utxo with null isValid
Summary:
T1920 related
Recently dev work has been going on to send and parse OP_RETURN transactions with Cashtab. However, during this work, we've learned that bch-api (through SLPDB) is confused by transactions with OP_RETURN msgs that are not eToken txs. Specifically, the validation function will return null.
Because SLPDB will also return isValid: null when the backend is rate limited, the old behavior of Cashtab threw an error that would change the API or lock the app until the API was not rate limited. However, in this case the issue is not a rate limit. So, if a user has a utxo with a normal OP_RETURN msg in it...Cashtab will perpetually throw a rate limit error.
This diff corrects this behavior. Cashtab already filters out isValid: null utxos from the utxo set (lines 434 and 443 of useBCH.js).
Future diffs will parse these utxos appropriately. However, since neither SLPDB nor bch-api do this, will be a bit complicated; probably screening OP_RETURN fields for SLP prefixes.
Test Plan:
arc patch d10363 and npm start to run a branch of cashtab that will allow you to send yourself an OP_RETURN tx (alt: send your cashtab wallet an OP_RETURN msg tx)
Note that the wallet throws an API error and never recovers
arc patch D10368 and npm start
Note that wallet recovers, though the null utxo is logged to console
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: emack, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10368