handling tuples (structs)
in solidity verion 0.4.19 tuples are supported, which allow structs as input-params. The current encoder in web3-eth-abi does not support them yet.
a definition of them can be found here: http://solidity.readthedocs.io/en/develop/abi-spec.html?highlight=tuple#handling-tuple-types
example:
[
{
"name": "f",
"type": "function",
"inputs": [
{
"name": "s",
"type": "tuple",
"components": [
{
"name": "a",
"type": "uint256"
},
{
"name": "b",
"type": "uint256[]"
},
{
"name": "c",
"type": "tuple[]",
"components": [
{
"name": "x",
"type": "uint256"
},
{
"name": "y",
"type": "uint256"
}
]
}
]
},
{
"name": "t",
"type": "tuple",
"components": [
{
"name": "x",
"type": "uint256"
},
{
"name": "y",
"type": "uint256"
}
]
},
{
"name": "a",
"type": "uint256"
}
],
"outputs": []
}
]
We should definitely support that. I started looking into this. Any help would be welcome.
Any updates on this? Thanks.
Will it be available for solidity view function too ?
This will be a great feature, it will let me focus more of the filtering on the frontend instead of within the contract. Also should reduce the number of calls to the contract. Any idea when a feature like this might be ready?
Any updates?
+1
@OlyRice ethers.js have this working now https://github.com/ethers-io/ethers.js/issues/84
+1
+1
++;
03.02.2018 7:10 PM "Phil" [email protected] napisał(a):
+1
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ethereum/web3.js/issues/1241#issuecomment-362841404, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiASdWz1fh5hJEBQ5RT0ImwOh_ted5Mks5tRKERgaJpZM4RIdkx .
+= 1;
+1
I've encountered this issue now using Truffle. I looked at the link with the definition, but I don't understand it. Could ethers.js and web3 share the same code?
+1
+1
Im on this in the #newAbiLib branch, but wont be able to finish the next two weeks, as im on holidays.
Just ran into the same thing, wanting to pass a struct as a constructor argument with contract.new(constructorArg, {data:...});
I've joined to waiting
+1
@frozeman any news on this?