Skip to content
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 support for tuples in the ABI #6

Open
francescortiz opened this issue Jul 20, 2018 · 2 comments
Open

Add support for tuples in the ABI #6

francescortiz opened this issue Jul 20, 2018 · 2 comments

Comments

@francescortiz
Copy link

I found out that when the generator fins a tuple it outputs tuple-ERROR!. The tuple implementation could consist of two phases:

  1. Just defining the tuple:
testFunc : Address -> ( String, BigInt ) -> Call BigInt
  1. Later on adding a solidity parser that looks for struct definitions and creates a type alias for those cases:

type alias SomeTypeWithAssociatedStruct = 
  { name : String
  , id : BigInt
  }

testFunc : Address -> SomeTypeWithAssociatedStruct -> Call BigInt

I have almost no experience with Haskell, but I will try implement if it is not implemented when the time comes when I need to use it.

@cmditch
Copy link
Owner

cmditch commented Jul 20, 2018

Can you post a small solidity contract which produces the error? Need to get an idea of what solidity code is producing the erroneous ABI.

Thanks

@cmditch
Copy link
Owner

cmditch commented Jul 20, 2018

@francescortiz Come to think of it, I'm not aware of a tuple type in the ABI. Public and externally callable functions with multiple parameters are indeed supported by elm-ethereum/elm-ethereum-generator. Very curious to see how your generating an ABI which includes a tuple type. Just to clarify, you're using Solidity?

Edit: Nvm, I see now. Looks like as of 0.4.19 you can pass structs in. I'd say for the time being see if you can pass multiple parameters into the function, instead of a single struct parameter. Or bake up an implementation of tuple encoding in elm-ethereum, and we can add support in elm-ethereum-generator.

Thanks for bringing this to my attention! Such a fast moving world.

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

No branches or pull requests

2 participants