Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Adaptive address prefix #9

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

nemoforte
Copy link
Collaborator

This branch introduces support for a default bech32 address prefix (hrp) queried from the network, and thus specific to each network. Until now, default prefix was hardcoded ('kira'), which was removed in this branch. The new model for the default bech32 prefix was already introduced on Adaptive Default Token feature, which has analogous purpose and was initially intended to implement together. But due to work organization purposes, the Adaptive Bech32 Address Prefix is introduced separately.

List of changes:

  • deleted wallet_details.dart which contained hardcoded default bech32 prefix
  • created getter "bech32Address" in wallet_address.dart, which extracts the hrp data from QueryTokenAliases or QueryValidators
  • created "WalletAddress.fromBech32ValidatorsPage()" to enable viewing addresses in ValidatorsPage when not signed in. Also, changed "bech32Hrp" field to optional, because it is needed only to store the bech32 hrp value in case of using this constructor.
  • cleaned up wallet_address.dart - removed not used and invalid methods related to hex. They were created based on wrong assumptions 2 years ago.
  • modified tab list controllers, so that each of them requires Wallet Address and uses its getter to get default prefix from Network Module. This change solved bug with broken queries (if network changed, but address in request contained old prefix).
  • changed "valoperWalletAddress" to String value "valkey", because wallet should only represent signed in user, and valkey prefix should be fetched from network
  • changed order of tests in identity_registrar_cubit_test.dart to properly simulate the process after implementing My Account access block - cannot get IR data without getting bech32 prefix from network

This branch introduces support for a default bech32 address prefix (hrp) queried from the network, and thus specific to each network. Until now, default prefix was hardcoded ('kira'), which was removed in this branch. The new model for the default bech32 prefix was already introduced on Adaptive Default Token feature, which has analogous purpose and was initially intended to implement together. But due to work organization purposes, the Adaptive Bech32 Address Prefix is introduced separately.

List of changes:
- deleted wallet_details.dart which contained hardcoded default bech32 prefix
- created getter "bech32Address" in wallet_address.dart, which extracts the hrp data from QueryTokenAliases or QueryValidators
- created "WalletAddress.fromBech32ValidatorsPage()" to enable viewing addresses in ValidatorsPage when not signed in. Also, changed "bech32Hrp" field to optional, because it is needed only to store the bech32 hrp value in case of using this constructor.
- cleaned up wallet_address.dart - removed not used and invalid methods related to hex. They were created based on wrong assumptions 2 years ago.
- modified tab list controllers, so that each of them requires Wallet Address and uses its getter to get default prefix from Network Module. This change solved bug with broken queries (if network changed, but address in request contained old prefix).
- changed "valoperWalletAddress" to String value "valkey", because wallet should only represent signed in user, and valkey prefix should be fetched from network
- changed order of tests in identity_registrar_cubit_test.dart to properly simulate the process after implementing My Account access block - cannot get IR data without getting bech32 prefix from network
@nemoforte nemoforte requested review from kronikarz and dpajak99 March 26, 2024 08:44
@kronikarz kronikarz merged commit 797cfb9 into dev Mar 26, 2024
3 checks passed
@kronikarz kronikarz deleted the mj-feature/adaptive-address-prefix branch March 26, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants