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
feat: r/profile dapp #1983
base: master
Are you sure you want to change the base?
feat: r/profile dapp #1983
Conversation
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.
Nice work - I left some comments that should be addressed before merging. Please take a look 🙏
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1983 +/- ##
==========================================
- Coverage 55.01% 54.18% -0.83%
==========================================
Files 481 520 +39
Lines 67432 73038 +5606
==========================================
+ Hits 37097 39576 +2479
- Misses 27318 30245 +2927
- Partials 3017 3217 +200 ☔ View full report in Codecov by Sentry. |
@leohhhn would it be possible to have a new review please? |
Website string | ||
Country string | ||
City string | ||
ModificationHistory map[string][]string |
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.
Maps aren't deterministic in some operations. I guess that's why avl.Tree was made (correct me if wrong please, @leohhhn ). So it could be a dangerous way to store the modification history. It would be better if you use an avl.Tree{time -> []string}
instead, and since it's stored lexicographically, you can store the data based on yyyy-mm-dd-time
.
type UserProfile struct { | ||
Username string | ||
Address std.Address | ||
AvatarURL string |
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.
Will there be an off chain way to verify the link is broken? Maybe with an NFT storage website it could be solved, but I'm not sure about the costs.
AvatarURL string | ||
Age string | ||
Gender string | ||
Website string |
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.
Could we convert this variable website
into an avl.Tree{} so the user can add as many websites as s/he wants? For example if you want to use your GitHub or your X account, it would be great to add the name of the website and the link to it.
if value, exists := profiles.Get(address.String()); exists { | ||
return value.(UserProfile).Gender | ||
} | ||
} else if username != "" { |
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.
You don't necessarily need an else if
. Instead only using an if
can solve your thing.
return "unknown path" | ||
} | ||
|
||
func renderHome() string { |
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.
Is there any way to hide your own information when the content is returned to another address? Will be all or nothing?
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.
You mean having something that allows you to put your profile in private? And if the “private” mode is active, if another address calls the profile, the information will be hidden?
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.
Well, that's another option, but what I meant at first was hiding some properties of your profile. Your idea is also a good one. Maybe you could associate each user to an avl.Tree and add a list of allowed addresses that can read their account. It's not an absolute solution to privacy since they can check your account in gnoscan, but it's a good starting point.
Following this PR concerning the creation of a realm
profile
I created this realm which allows the creation of profile as well as the associated functions to display the information of a profile with an address or a username. I have some questions concerning this realm:Thanks in advance for your feedback
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description