Page MenuHomePhabricator

[Cashtab][Alias] Move getAliasRegistrationFee into aliasUtils
ClosedPublic

Authored by emack on Jul 10 2023, 05:54.

Details

Summary

T3216

All alias related utilities are being consolidated in aliasUtils, hence moving getAliasRegistrationFee and it's helper function getAliasByteSize (only used in getAliasRegistrationFee).
Associated unit tests migrated accordingly.

Test Plan

grep -r getAliasRegistrationFee src/ and ensure references are to aliasUtils.js
grep -r getAliasByteSize src/ and ensure references are to aliasUtils.js
npm test
set alias flag to true in Ticker.js
npm start
navigate to Alias page, input an alias and ensure the size/price preview is correct

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested review of this revision.Jul 10 2023, 05:54
Fabien added a subscriber: Fabien.

OK with the function move, but the registration fees should not be hardcoded in cashtab. A much better strategy is to gather them from the alias server via some endpoint so maintenance happens at a single place and the price is publicly accessible to anybody without having to dig into the spec. It also can be changed much more easily if somebody else decides to build another registration app.

This revision is now accepted and ready to land.Jul 10 2023, 16:17

OK with the function move, but the registration fees should not be hardcoded in cashtab. A much better strategy is to gather them from the alias server via some endpoint so maintenance happens at a single place and the price is publicly accessible to anybody without having to dig into the spec. It also can be changed much more easily if somebody else decides to build another registration app.

yup agreed, Joey's got the price endpoint going now so there'll be an upcoming diff to use that as the single source of truth.