-
Notifications
You must be signed in to change notification settings - Fork 523
Refactoring ABI encoding feature #3055
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
Conversation
jasonpaulos
left a comment
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.
Looks good, just one nit
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.
To combine a couple of my points into one, maybe you should just have one TypeOf(string) function, which would replace TypeFromString(), and would be used even for getting other types. TypeOf("bool") for example. Provides a nice narrow interface. I don't know if callers need MakeUintType(int). I suspect not, and that TypeOf("uint16") etc is better, because callers will not be dynamically selecting a type programatically.
Perhaps the others would continue to exist, but not as public (capitalized) functions.
|
My thoughts is that, probably hide most of the NVM, we are hiding all these type constructors for now. |
jasonpaulos
left a comment
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.
Overall looks good, just 2 nits
Removed data/abi/abi_value.go Encode/Decode method take golang values, the behavior should be based on ABI type schemes
Summary
data/abi/abi_value.gocloses #3027
Test Plan
Minor Question
We will have to use reflection for inferring if
interface{}typed value can be type-asserted to be[]interface{}.We cannot directly do
a.([]interface{}), that's why reflection comes in to achieveinterface{} -> []interface{}.Any thoughts on possible work-arounds? The perf seems not penalized...