-
Notifications
You must be signed in to change notification settings - Fork 371
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(home-realm): add interactive home realm example #2918
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2918 +/- ##
==========================================
+ Coverage 63.07% 63.08% +0.01%
==========================================
Files 563 563
Lines 79254 79254
==========================================
+ Hits 49986 49996 +10
+ Misses 25904 25895 -9
+ Partials 3364 3363 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Add profile picture, background image, and about section rendering - Implement dynamic background and tip jar rendering - Add functions to update cities and tip jar link - Integrate sponsor leaderboard - Home realm is still a work in progress
- Ensure city index increments with each donation, resetting after the last city - Implement full GNOT validation to enforce valid donations - Complete sponsor leaderboard functionality with maxSponsors limit - Refine sponsor list display logic to prevent visual issues - Fully integrate tip jar mechanics with donation tracking - Fix AssertAuth issue in config
- Remove ownership management logic from `config` and rename it to `registar`. - Integrate `Ownable` for ownership management in the home package. - Add a comment to clarify the purpose of `jarLink` and its expected update process. - Remove the unused `caption` parameter in the `UpdatePFP` function. - Replace `OrigPkgAddr()` with `CurrentRealm()` in `CollectDonations`.
- Run `gno mod tidy` to clean up dependencies. - Run `gno fmt -C ./examples` to format code. - Clean up by fixing the undefined `owner` reference and other minor bugs.
I’ve resolved some issues with the latest commits and will be addressing the remaining problems soon. Thank you for your comprehensive suggestions! |
- Refactor the `currentCityIndex` update using modulo (`%`) to prevent manual resetting and ensure correct rendering. - Merge sponsor and donation logic into a single structure, simplifying data handling. - Replace sponsor list iteration with a map for direct access, enhancing performance. - Remove `CollectDonations` function; `Donate` now directly sends funds to the owner, simplifying fund management. - Move sponsor sorting from the donation step to the render step, reducing gas fees for donors. - Generalize the `UpdateAboutMe` method to support dynamic content updates without column restrictions. - Group related variables (e.g., `pfp`, `cities`, `aboutMe`, `jarLink`) into common objects for improved organization. - Apply minor optimizations and clean up code for better readability and maintainability.
- Re-add UpdateMaxSponsors function, accidentally removed earlier. - Replace DonationStats with DonationsCount field. - Update logic to derive total donations directly from the sponsors map by summing "ugnot" coins.
if len(sponsorship.sponsors) == 0 { | ||
out += `<p style="text-align: center;">No sponsors yet. Be the first to tip the jar!</p>` + "\n" | ||
} else { |
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.
if len(sponsorship.sponsors) == 0 { | |
out += `<p style="text-align: center;">No sponsors yet. Be the first to tip the jar!</p>` + "\n" | |
} else { | |
if len(sponsorship.sponsors) == 0 { | |
return out + `<p style="text-align: center;">No sponsors yet. Be the first to tip the jar!</p>` + "\n" | |
} | |
// ... |
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.
Fixed! 22531c7
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 can drop the else
, since you return in the if
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.
Thank you for applying the suggestions 🙏
@stefann-01 |
@stefann-01 Can you check the leftover comments, so we can merge? 🙏 |
Yes, I will fix them all tonight. Thanks! @zivkovicmilos |
- Add AddCities function to append one or more cities to the travel list without replacing the existing entries. - Add AddAboutMeRows function to append one or more rows to the aboutMe section. - Implemented unit tests for home realm.
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.
Looking good 😎
) | ||
|
||
func TestUpdatePFP(t *testing.T) { | ||
std.TestSetOrigCaller(std.Address("g1sd5ezmxt4rwpy52u6wl3l3y085n8x0p6nllxm8")) |
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.
Nitpick: you should use testutils.TestAddress(...)
to create an std.Address
in tests
Description:
This PR finalizes the core functionality of my home realm project, focusing on a dynamic and interactive home realm experience, driven by GNOT donations. The following key features and enhancements are introduced in this PR:
Key Features:
Dynamic Background Change:
Sponsor Leaderboard:
maxSponsors
setting.Donation Validation:
Owner Withdrawal of Donations:
Home Realm Configurations:
maxSponsors
setting.