-
Notifications
You must be signed in to change notification settings - Fork 140
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
Refactor existing native composite types/values to use CompositeType and CompositeValue #698
Conversation
dbd6b00
to
6739995
Compare
d725d22
to
90d63df
Compare
Thank you for cleaning this up @SupunS! Would it be OK if we would wait and merge this into the next major release? It's a big change and it might be good to only merge minor fixes for now |
@turbolent yes, that would be a good idea. I will see if there are other possible types we could refactor, and get them in too. Then maybe we could push everything at once. |
90d63df
to
534a83c
Compare
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.
Great clean-up! 👏
I just had one concern regarding backwards-compatibility for stored data
@@ -5278,6 +5278,7 @@ type CompositeValue struct { | |||
Owner *common.Address | |||
destroyed bool | |||
modified bool | |||
stringer func() string |
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.
👍
} | ||
|
||
payerAddress := payerAddressValue.(interpreter.AddressValue).ToAddress() |
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.
👍
}() | ||
|
||
func init() { | ||
// Set the container type after initializing the `AuthAccountContractsType`, to avoid initializing loop. |
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.
👍
534a83c
to
310976f
Compare
eac96cc
to
79e464b
Compare
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.
Very nice!
Closes #650
Closes #661
Description
Some native composite values and types (e.g. AuthAccount, AuthAccount.Contracts, PublicAccount, etc.) are defined through separate Go types implementing the
Value
interface (e.g. AuthAccountValue) andType
interface (e.g. AuthAccountType).This PR refactor those existing values and types to use
CompositeValue
andCompositeType
respectively.For contributor use:
master
branchFiles changed
in the Github PR explorer