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

Remove marshaling from transfer action #1647

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Remove marshaling from transfer action #1647

merged 3 commits into from
Oct 10, 2024

Conversation

samliok
Copy link
Contributor

@samliok samliok commented Oct 9, 2024

This is not needed any more because we can just use the ABI package to provide the correct format

@@ -33,7 +33,7 @@ func init() {
errs.Add(
// When registering new actions, ALWAYS make sure to append at the end.
// Pass nil as second argument if manual marshalling isn't needed (if in doubt, you probably don't)
ActionParser.Register(&actions.Transfer{}, actions.UnmarshalTransfer),
ActionParser.Register(&actions.Transfer{}, nil),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confused by the register function. It uses avalanchego's linearcodec, so where does the new abi package play into here?

func (p *TypeParser[T]) Register(instance Typed, f func(*Packer) (T, error)) error {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is responsible for defining structs so they can be transferred between languages. If all implementations were in Golang, we wouldn't need an ABI.

Copy link
Contributor

@containerman17 containerman17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support this, but we need to include the example of marshaling somewhere in the docs.

Copy link
Collaborator

@aaronbuchwald aaronbuchwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aaronbuchwald
Copy link
Collaborator

I support this, but we need to include the example of marshaling somewhere in the docs.

I'm alright with dropping this from the docs for now. I don't think anybody should be using this for now and we can either deprecate it completely or add to the docs in the future.

@aaronbuchwald aaronbuchwald merged commit 5d8c590 into main Oct 10, 2024
17 checks passed
@joshua-kim joshua-kim deleted the morpheus-abi branch October 10, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants