Page MenuHomePhabricator

[Cashtab] [Alias] pt 5 - Implement getAddressFromAlias function
ClosedPublic

Authored by emack on Jan 20 2023, 01:50.

Details

Summary

T2551

Depends on D12908

This diff builds out the getAddressFromAlias function, which based on feedback in earlier parts, is now a simple helper method rather than an async call that validates caching. It parses through the alises in storage and returns the corresponding address. In edge cases where there are no matching aliases in storage and caching is up to date, then this function will return false.

mockAliasLocalStorage has been moved out of isAddressRegistered and into mocks so it can be utilized across multiple functions and the unit tests for getAddressFromAlias.

Part 6 will be where caching is implemented and mocked cache objects removed.

[Cashtab] [Alias] pt 1 - Create scaffold for new Identity component
[Cashtab] [Alias] pt 2 - Implement registerNewAlias() to handle alias registration
[Cashtab] [Alias] pt 3 - Implement isAliasAvailable function
[Cashtab] [Alias] pt 4 - Implement isAddressRegistered function
[Cashtab] [Alias] pt 5 - Implement getAddressFromAlias function
[Cashtab] [Alias] pt 6 - Implement isLocalAliasStateLatest function
[Cashtab] [Alias] pt 7 - Enable alias lookup for Send XEC component
[Cashtab] [Alias] pt 8 - Enable alias lookup for Send Token component
[Cashtab] [Alias] pt 9 - Implement pricing mechanism
[Cashtab] [Alias] pt 10 - Server cron job
[Cashtab] [Alias] pt 11 - Upgrade tx history to recognize alias registration txs

Test Plan

npm test and ensure the two unit tests for getAddressFromAlias passes.

Diff Detail

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

Event Timeline

emack requested review of this revision.Jan 20 2023, 01:50
This revision is now accepted and ready to land.Jan 20 2023, 14:10