TypeChain icon indicating copy to clipboard operation
TypeChain copied to clipboard

Possibility of enabling structs for truffle-v5 target?

Open jnaviask opened this issue 4 years ago • 4 comments

Based on this comment (and my own experience using the tool), structs do not get compiled for the truffle-v5 target: https://github.com/ethereum-ts/TypeChain/blob/f63bbe3504bb82eec2d683850998d8547b05f825/packages/target-truffle-v5-test/test/DataTypesView.test.ts#L35

I'm wondering what would need to change to permit struct generation in truffle-v5 and whether it's possible to reenable this feature. Thanks!

jnaviask avatar Jun 03 '20 16:06 jnaviask

Hey @jnaviask

It seems like this comment is outdated. Now tests use solidity: 0.6.4. AFAIR I had a problem getting structs to work with truffle and hence the comment.

If you have a working code example of Truffle-v5 with structs in JS, you can paste it here and actually fixing it shouldn't be that difficult so I encourage you to give it a try.

krzkaczor avatar Jun 11 '20 17:06 krzkaczor

Pretty much any contract should work. I was trying to get it working with these Moloch contracts https://github.com/MolochVentures/moloch/tree/master/v1_contracts and it simply omits the struct definitions when I compile to typescript targeting truffle-v5. I can give the fix a shot later today or Monday, hopefully just uncommenting those lines should do the trick.

jnaviask avatar Jun 12 '20 14:06 jnaviask

any updates on this?

sirpy avatar Dec 21 '20 08:12 sirpy

Any news?

TmLev avatar Feb 17 '22 13:02 TmLev