-
Notifications
You must be signed in to change notification settings - Fork 9
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
support for non primitive types #30
Comments
I see two use cases:
I think (1) is more important This should be implemented using a serialization library of some sort as part of the contract SDK There are 3 main serialization candidates, we can support all 3:
|
From a product perspective, what do you say about API like this: type Person struct {
Name string
Age uint32
}
func someFunc() {
schema := "{Name: string, Age: uint32}"
var p Person
person := serializer.Decode(bytes, &p)
bytes := serializer.Encode(p) The benefit here is that we have clearer expression of the schema for working across languages.. This is very similar to ABI btw.. so maybe just using Ethereum's approach would be good here and no need to do our own |
As of now, there is no support for non primitive types on the sdk. It would a lot easier for a developer to write smart contracts if there was support for structs and other non primitive types.
In addition, the user cannot serialize structs or interfaces because it is not possible to write those types in the smart contract nor to import them from other libraries that the user may have created
The text was updated successfully, but these errors were encountered: