Using @typechain/truffle-v5

Đang mở
#548 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
blockchain

Hướng nghiên cứu

Start in package.json, where the Truffle v5 and TypeChain dependencies are declared, then inspect uses of LockupInstance and depositToProperty. Update the affected calls and type inferences for @typechain/truffle-v5 while preserving existing assertions and behavior; done means the existing test cases pass in CI without type errors.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
Detailed description

Currently, this project is using Truffle v5.

https://github.com/dev-protocol/protocol-v2/blob/2abee70352043073e5841ec04cb1d0363b774cf1/package.json#L49

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

https://github.com/dev-protocol/protocol-v2/blob/2abee70352043073e5841ec04cb1d0363b774cf1/package.json#L7
https://github.com/dev-protocol/protocol-v2/blob/2abee70352043073e5841ec04cb1d0363b774cf1/package.json#L28

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
Ngôn ngữ chính
TypeScript
Star
18
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dev-protocol/protocol-v2

Tất cả issue của dev-protocol/protocol-v2

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.