Page MenuHomePhabricator

[tg bot] parse etoken txs
AbandonedPublic

Authored by bytesofman on Mar 15 2023, 04:59.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

T2972

Parse eToken send txs and include a summary of them in telegram msgs on confirmed blocks

Test Plan

npm test
npm run msgs

Diff Detail

Repository
rABC Bitcoin ABC
Branch
tg-bot-parse-etoken-txs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22460
Build 44545: Build Diff
Build 44544: arc lint + arc unit

Event Timeline

I started this diff without realizing how complicated it would be. This needs to be split up into smaller parts before it's production ready. Will be running this in dev tho just to give it a go.

How to stack this diff:

  • Add module ecashaddrjs and util function outputScriptToAddress D13362
  • Add util function returnAddressPreview D13363
  • Modify parseTx function to iterate over tx inputs and collect slp tokenSend info; new params isTokenSendTx and tokenSendInfo D13364
  • Modify parseBlock function to collect tokenIds needed for genesesInfo query D13365
  • Add function returnChronikTokenInfoPromise to support Promise.all() calls for token genesisInfo D13366
  • Clean up the logic of the try...catch loop in index.js and generateMocks.js so that it is standardized, i.e. you can call the same function on parsedBlock to get parsedBlockWithTokenInfo in both places D13366
  • Modify getBlockTgMessage to describe token send txs in telegram msgs D13368

Handle case of message being too long to send (truncate / split into multiple msgs) eliminated in these mocks by linking txid instead of both addresses of token send txs; other outstanding task to handle it in general

  • Handle bux token txs that are sent to self, e.g. in block 783465 D13368 ended up having to handle it here to prevent errors in tests