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

feat(amino): Add TypeDesc Amino implementation and TypedValue marshaler #2113

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

gfanton
Copy link
Member

@gfanton gfanton commented May 15, 2024

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:

  1. The methods in gnonative are intended for general use and may be removed later, while the ones here are focused solely on marshaling and unmarshaling.
  2. These methods can be simpler, as they do not require the full support of reflection, enabling a more detailed implementation.
  3. We assume prior knowledge of the type of the TypedValue, simplifying its management.
  4. 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: xxx message 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.

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@github-actions github-actions bot added 📦 🤖 gnovm Issues or PRs gnovm related 📦 🌐 tendermint v2 Issues or PRs tm2 related labels May 15, 2024
Copy link

codecov bot commented May 15, 2024

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Copy link

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.

@github-actions github-actions bot added Stale and removed Stale labels Nov 16, 2024
@jefft0 jefft0 added the Stale label Nov 28, 2024
@github-actions github-actions bot removed the Stale label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: No status
Status: Triage
Development

Successfully merging this pull request may close these issues.

2 participants