Skip to content
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

Using @typechain/truffle-v5 #548

Open
1 task done
aggre opened this issue Jan 12, 2023 · 0 comments
Open
1 task done

Using @typechain/truffle-v5 #548

aggre opened this issue Jan 12, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@aggre
Copy link
Member

aggre commented Jan 12, 2023

Detailed description

Currently, this project is using Truffle v5.

"truffle": "5.4.1",

But Typechain is targeted as @typechain/truffle-v4.

"generate": "yarn compile && typechain --target=truffle-v4 './build/**/*.json'",

"@typechain/truffle-v4": "4.1.0",

We need to use @typechain/truffle-v5.

Context

Changing the Typechain version should result in many type errors, but as long as the existing test cases pass the CI, the existing codes are certainly executable code.

So, we will need to change function callings or type inferences to accommodate the new types, but basically the assertions and behavior itself should not need to change.

Possible implementation

No response

Additional information

As I tried it locally... it seems like the following major changes are needed:

  • LockupInstance type is no longer exports depositToProperty, it exports methods['depositToProperty(address,uint256)'] and methods['depositToProperty(address,uint256,bytes32)'] instead of it.
  • Truffle is no longer uses BigNumber.js, it uses bn.js instead of it. But we only use the interfaces common to both and test cases have no problem.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@aggre aggre added the enhancement New feature or request label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant