Open forshtat opened 3 years ago
In case this is to be viewed as an issue for the Truffle project itself also created an issue there: https://github.com/trufflesuite/truffle/issues/3914
Is this maybe related to the web3 issue discussed on this recent PR?
Is this maybe related to the web3 issue discussed on this recent PR?
A little, but the mentioned issue is about the types of accepted inputs within structs, and this issue is about types of outputs when a struct is returned, so the issues are not identical.
OK. I think we can wait for some response on trufflesuite/truffle#3914 -- if it's a bug in truffle, we can just wait for them to fix it and then bump minimum typechain's truffle version.
Until that happens, we can fix Typechain for the current Truffle version too -- PRs welcome :)
Actual:
The generated types for calls to a solidity method that returns a struct make all integer fields be
BN
.However, this is not what Truffle currently does with structs. It leaves these values be returned as strings, so generated types are not usable in our project.
For example , the following code:
will result in the following type declaration:
but it is trivial to see that event the Truffle console does not treat these values as 'BN':
So the expected type declaration must be