-
Notifications
You must be signed in to change notification settings - Fork 361
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
[Bug] Static call and function calls doesn't match whats in the function property #590
Comments
@krzkaczor it looks like strings are considered objects and outputted as array of 1. |
this is the log of what a string output variable in solidity is seen as in
this is only for functions that are under the property in a contract type
|
here is a link to a reproduction: https://github.com/dethcrypto/TypeChain/pull/593/files#r778495210 |
@ShravanSunder have you tested it? I just verified it and it's how ethers work -- for some reason functions. wrap result in an array. We have tests covering this behavior: https://github.com/dethcrypto/TypeChain/blob/master/packages/target-ethers-v5-test/test/DataTypesInput.test.ts#L47 I am gonna close it for now. Feel free to reopen if I am wrong. and btw. this is controlled by this switch: https://github.com/dethcrypto/TypeChain/blob/master/packages/target-ethers-v5/src/codegen/index.ts#L81 |
Please repoen if this is still a problem. |
Issue with type generation
Using ethersv5 and typechain and hardhat
Below of is a snippet of a simple test contract:
Typechain generates a
purpose
function that has multiple return types. string and [string] as shown below.This is what typechain generates
The return type of
does not match the static call and function call return type
Possible Cause
It seems to have to do with something with the
target-ethers-v5
implementation ofgenerateOutputTypes
https://github.com/ShravanSunder/TypeChain/blob/c0e175b3b6e8176d66bbbcc7f44e00987dd0e615/packages/target-ethers-v5/src/codegen/types.ts#L22-L28
The text was updated successfully, but these errors were encountered: