dethcrypto / TypeChain

🔌 TypeScript bindings for Ethereum smart contracts
MIT License
2.76k stars 361 forks source link

Possibility of enabling structs for truffle-v5 target? #245

Open jnaviask opened 4 years ago

jnaviask commented 4 years ago

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!

krzkaczor commented 4 years ago

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.

jnaviask commented 4 years ago

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.

sirpy commented 3 years ago

any updates on this?

TmLev commented 2 years ago

Any news?