Page MenuHomePhabricator

[token-server] Link token blacklist with icon approval actions
ClosedPublic

Authored by bytesofman on Tue, Oct 29, 21:27.

Details

Summary

Add unit-tested functions for adding or removing an entry from the blacklist.

Update the telegram bot callback function to add tokenId to blacklist when icon is removed, and remove from blacklist when icon is restored. Add log statements to confirm.

Test Plan

npm test

The telegram bot is impractical to test. The change is imo simple enough to "see if it works", given we are only adding tested functions. There's a chance the telegram API does not like that I made the callback async or some other issue. Will revert in this case.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
blacklist-tg-update
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30914
Build 61331: Build Difftoken-server-tests
Build 61330: arc lint + arc unit

Event Timeline

emack requested changes to this revision.Wed, Oct 30, 01:36
emack added a subscriber: emack.
emack added inline comments.
apps/token-server/src/telegram.ts
78 ↗(On Diff #50539)

why the hardcoding of the metamask reason? was this inadvertently copied over from unit tests? because I can't see where this metadata is updated after this.

This revision now requires changes to proceed.Wed, Oct 30, 01:36
apps/token-server/src/telegram.ts
78 ↗(On Diff #50539)

oops. yeah copied from test.

change reason from bot report

apps/token-server/src/telegram.ts
78

this will still be constant for now (vs updates that are manually pushed to the database)

could mb add an easy way to add more descriptions without going into the database, but this is good enough to see if it works. more features would be in later diffs.

This revision is now accepted and ready to land.Wed, Oct 30, 06:27