HomePhabricator

[Cashtab + token-server] Bump icon upload size and validate icon size before…

Description

[Cashtab + token-server] Bump icon upload size and validate icon size before token creation

Summary:
Cashtab already resizes icons before upload to 512x512. In practice, it is hard to get an icon over 1,000,000 bytes. But, it is pretty easy to get one over 500,000 bytes, esp if the square shape is selected.

Bump the limit to 1,000,000 bytes (which is unexpected to be hit by Cashtab). Add validation to Cashtab to disable token creation if the server is expected to reject the icon.

Test Plan:
npm test

I was not able to test this directly with these limits, as Cashtab always resized even large images to below 1,000,000 bytes. But, you can verify the button disables and the disabled msg appears by changing the value of ICON_MAX_UPLOAD_BYTES to, say, 100. Then add an icon and see the error msg.

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

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

Details

Provenance
bytesofmanAuthored on Thu, Apr 25, 22:15
bytesofmanPushed on Sat, Apr 27, 00:13
Reviewer
Restricted Project
Differential Revision
D16054: [Cashtab + token-server] Bump icon upload size and validate icon size before token creation
Parents
rABC4543714e20b7: [explorer] Make the specification a clickable link
Branches
Unknown
Tags
Unknown