HomePhabricator

[alias-server] Add util functions for getting byte count, use them to patch tg…

Description

[alias-server] Add util functions for getting byte count, use them to patch tg bot bytecount bug

Summary:
T2976

Depends on D13246

Telegram bot was giving utf8 length instead of hex bytecount. Per the spec, pricing will be determined by hex bytecount.

This diff corrects the issue with the telegram bot and introduces utility functions for converting between utf8 and hex.

Test Plan:
Review new util functions, new unit tests, and npm test
node index.js, create some aliases in cashtab with emojis, note telegram bot now counts emojis as 4 bytes

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D13247

Details

Provenance
bytesofmanAuthored on Mar 6 2023, 23:59
bytesofmanPushed on Mar 8 2023, 17:46
Reviewer
Restricted Project
Differential Revision
D13247: [alias-server] Add util functions for getting byte count, use them to patch tg bot bytecount bug
Parents
rABC14689ad614aa: [alias-server] Improve code organization, generate mocks from script
Branches
Unknown
Tags
Unknown