[Cashtab][Alias] Patch silent bugs introduced by spec change
Summary:
The alias spec redesign a few months ago silently broke a few parseChronikTx related elements. These should be patched together under this single diff as updating the unit test mock will break multiple unit test vectors.
- The rendering of the alias name in the tx history tab was no longer being rendered. parseChronikTx was expecting the alias name to be the 2nd array element parsedOpReturnArray[1], which based on the lastest alias spec is now the version number. The alias name is actually the 3rd element in the array now. The unit tests didn't pick this up because the unit test mock data was based on the old spec where the alias name was the 2nd element in the opreturn array. Mock now updated with a live example from explorer.
- The live alias registration tx was being incorrectly parsed as incoming by parseChronikTx's unit test. This is because the hash160 mockParseTxWallet didn't match the hash160 from the live example taken from explorer. Added mockParseAliasTxWallet to chronikTxHistory mock. No issue with the code itself.
Test Plan:
- npm test
- npm start
- Check tx labelling, icon and amount for the following:
Load a wallet with an existing alias registration tx. Refresh the tx history and ensure label, icon, registration fee and alias name for that tx are displayed correctly.
Send and receive XEC tx.
Send and receive XEC tx with an unencrypted msg.
Send and receive one to many XEC tx.
Send and receive one to many XEC tx with an unencrypted msg.
Send and receive XEC tx with an encrypted msg.
Send and receive an eToken tx
Receive a message from another cashtab wallet.
Receive a message from another ElectrumABC wallet.
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D14587