-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add ABI-encoding feature #247
Conversation
f90e887
to
046b3db
Compare
14cc15c
to
7e6ee1a
Compare
57d7992
to
6f0e247
Compare
encoding/abi/abi.go
Outdated
"github.com/algorand/go-algorand/data/abi" | ||
) | ||
|
||
type Value struct { |
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.
@algorandskiy mentioned using struct embedding (e.g. type Value struct { abi.Value }
) to avoid having to declare methods again, such as Encode()
.
But would a simple type assignment work as well? E.g. type Value = abi.Value
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.
Wow looks like it works @ahangsu
I tried type aliasing (type Value abi.Value
) and it did not work
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.
That works, it can also remove the redundant method wrapper, leaving only necessary constructor, Decode
and TypeFromString
. Nice one :-)
This reverts commit fdcd3f6.
This reverts commit 48a72ca.
This reverts commit 48a72ca.
This PR adds the corresponding feature to #236.
We added a wrapper around the implementation in go-algorand merged in algorand/go-algorand#2807, and exported necessary interface in the sdk.