Skip to content

Conversation

@ahangsu
Copy link
Contributor

@ahangsu ahangsu commented Sep 27, 2021

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.

@ahangsu ahangsu marked this pull request as draft September 27, 2021 21:10
@ahangsu ahangsu force-pushed the abi-encoding branch 2 times, most recently from f90e887 to 046b3db Compare September 27, 2021 22:26
@ahangsu ahangsu marked this pull request as ready for review September 29, 2021 15:04
@jasonpaulos jasonpaulos linked an issue Sep 29, 2021 that may be closed by this pull request
"github.com/algorand/go-algorand/data/abi"
)

type Value struct {
Copy link
Contributor

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

Copy link
Contributor

@algorandskiy algorandskiy Sep 29, 2021

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

Copy link
Contributor Author

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 :-)

@algorandskiy algorandskiy merged commit fdcd3f6 into develop Sep 29, 2021
jasonpaulos added a commit that referenced this pull request Oct 4, 2021
jasonpaulos added a commit that referenced this pull request Oct 4, 2021
@jasonpaulos jasonpaulos deleted the abi-encoding branch October 4, 2021 23:39
algoidurovic pushed a commit to algoidurovic/go-algorand-sdk that referenced this pull request Nov 1, 2021
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.

Add ABI encoding support

4 participants