-
Notifications
You must be signed in to change notification settings - Fork 8
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
Displaying Deterministic Username for a given Token #1921
Conversation
…rator in GeneralUtils
Refactored RollCall attendee list UI to show username above the hash
# Conflicts: # fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/event/rollcall/RollCallArrayAdapter.kt # fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/event/rollcall/RollCallFragment.kt # fe2-android/app/src/main/res/values/strings.xml
…ername' into work-fe2-maxime-deterministic-username # Conflicts: # fe2-android/app/src/main/java/com/github/dedis/popstellar/utility/Constants.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! That's going to be a great feature :)
Just some comments
fe2-android/app/src/main/java/com/github/dedis/popstellar/model/objects/security/PublicKey.kt
Outdated
Show resolved
Hide resolved
.../app/src/main/java/com/github/dedis/popstellar/ui/lao/digitalcash/DigitalCashSendFragment.kt
Outdated
Show resolved
Hide resolved
...droid/app/src/main/java/com/github/dedis/popstellar/ui/lao/digitalcash/HistoryListAdapter.kt
Show resolved
Hide resolved
...mmon/java/com/github/dedis/popstellar/testutils/pages/lao/digitalcash/HistoryPageObject.java
Outdated
Show resolved
Hide resolved
Also, now that I'm looking at the screenshots, perhaps it's better to have the username using underscores or capitalized letters so the 2 words are more easily recognizable |
I'll check with FE1 and modify before merging edit : we decided to go for the capitalized version : |
- changed getUsername to getLabel (toUsername to label) in PublicKey - refactored getPublicKeyFromUsername to avoid code duplication (now in PublicKey as static) - removed unnecessary comments - disabled serialization of label in PublicKey
- changed getUsername to getLabel (toUsername to label) in PublicKey - refactored getPublicKeyFromUsername to avoid code duplication (now in PublicKey as static) - removed unnecessary comments - disabled serialization of label in PublicKey
…ername' into work-fe2-maxime-deterministic-username # Conflicts: # fe2-android/app/src/main/java/com/github/dedis/popstellar/model/objects/security/PublicKey.kt # fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/digitalcash/DigitalCashIssueFragment.kt # fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/digitalcash/DigitalCashSendFragment.kt
Quality Gate passed for 'PoP - PoPCHA-Web-Client'Issues Measures |
Quality Gate passed for 'PoP - Be2-Scala'Issues Measures |
Quality Gate passed for 'PoP - Be1-Go'Issues Measures |
Quality Gate passed for 'PoP - Fe2-Android'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just one comment
Assert.assertEquals(digits, pk.getLabel().substring(pk.getLabel().length - USERNAME_DIGITS)) | ||
} | ||
|
||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could add one or two more tests then just the empty username for the generateUsername function
Oh too late, it was merged while I was reviewing it |
PR Description
Context
Throughout the app, users were previously referred to by their PoP Token, which was not user-friendly. This PR implements a deterministic username system to improve the user experience. A detailed documentation of the project's idea and motivations is to be found in #1915. It is recommended to read it before diving into this PR.
Summary of Changes
This PR implements the deterministic username system across various parts of the app, ensuring a consistent and user-friendly display of usernames derived from PoP Tokens. The changes have been done in collaboration with FE2 (#1918) to ensure consistency throughout both systems.
General Changes
PublicKey
class now includes thegetUsername()
function, returning the username version of the hash.GeneralUtils
. The usernames are a concatenation of two mnemonics words, and a 4 digits number. The number corresponds to the 4 first digits in a token's hash, starting from the leftExample:
token :
d_xeXEsurEnyWOp04mrrMxC3m4cS-3jK_9_Aw-UYfww=
mnemonics words generated form the hash :
spoon
,issue
first 4 digits :
0434
final username :
spoonissue0434
Token
Social Media
Roll Call
RollCallArrayAdapter
to include two TextViews per item, and enhancing the class overall.Digital Cash
PublicKey
instead ofString
(token hashes).PublicKey
. Also, it juste made no sense to label this public key under a username anyway.Bugs and Documentation
Screenshots
Token fragment displaying the username.
Chirps feed displaying the username.
Roll call displaying the username.
Digital cash sending activity displaying the username.
Digital cash receipt activity displaying the username.
Digital cash transaction history activity displaying the username and the organizer hash.
Digital cash issuing activity.
Bugged UI in transaction history showing the corrected title and value (now fixed).