HomePhabricator

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

Description

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

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.

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Jan 20 2023, 01:48
emackPushed on Feb 22 2023, 04:05
Reviewer
Restricted Project
Differential Revision
D13015: [Cashtab] [Alias] pt 5 - Implement getAddressFromAlias function
Parents
rABCb137fcf02fa4: [Cashtab] [Alias] pt 4 - Implement isAddressRegistered function
Branches
Unknown
Tags
Unknown