feat(amino): Add TypeDesc Amino implementation and `TypedValue` marshaler
PS: This PR is still in draft, but I would welcome any feedback on it
This PR has two main objectives. The first is to add a TypeDesc method implementation to Amino, allowing a type to self-describe. The second is to introduce a new package, gnoamino, dedicated to (un)marshaling Gno types, starting with gnolang.TypedValue and its TypedValueWrapper, which implements the TypeDesc Amino method.
Most of the methods in TypedValueWrapper are inspired by or copied from gnonative.go. They are exported here for several reasons:
- The methods in
gnonativeare intended for general use and may be removed later, while the ones here are focused solely on marshaling and unmarshaling. - These methods can be simpler, as they do not require the full support of reflection, enabling a more detailed implementation.
- We assume prior knowledge of the type of the
TypedValue, simplifying its management. - We will likely implement gas consumption calculations within those methods.
Contributors' checklist...
- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a
BREAKING CHANGE: xxxmessage was included in the description - [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to generated graphs, if any. More info here.
Codecov Report
Attention: Patch coverage is 33.87097% with 41 lines in your changes missing coverage. Please review.
:loudspeaker: Thoughts on this report? Let us know!
This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months.
@gfanton I have this PR in my review queue from forever ago. Do you still need reviews?
🛠 PR Checks Summary
All Automated Checks passed. ✅
Manual Checks (for Reviewers):
- [ ] IGNORE the bot requirements for this PR (force green CI check)
Read More
🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.
✅ Automated Checks (for Contributors):
🟢 Maintainers must be able to edit this pull request (more info)
☑️ Contributor Actions:
- Fix any issues flagged by automated checks.
- Follow the Contributor Checklist to ensure your PR is ready for review.
- Add new tests, or document why they are unnecessary.
- Provide clear examples/screenshots, if necessary.
- Update documentation, if required.
- Ensure no breaking changes, or include
BREAKING CHANGEnotes. - Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
- Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)
If
🟢 Condition met └── 🟢 The pull request was created from a fork (head branch repo: gfanton/gno)Then
🟢 Requirement satisfied └── 🟢 Maintainer can modify this pull requestManual Checks
**IGNORE** the bot requirements for this PR (force green CI check)
If
🟢 Condition met └── 🟢 On every pull requestCan be checked by
- Any user with comment edit permission
@thehowl we can close it, it have been replaced by #2652