Page MenuHomePhabricator

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

Authored by bytesofman on Mar 7 2023, 00:01.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
save-aliases-lowercase
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22279
Build 44193: Build Diff
Build 44192: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 8 2023, 07:14