Open janaakhterov opened 2 years ago
Something to note here, with Java auto-generating these files already the hick-up we faced was when the protobufs renamed HederaFunctionality.Prng
-> HederaFunctionality.UtilPrng
. This would cause (and did cause) a breaking change in Java. So, the question is, should the SDKs keep up to date with the names in the protobufs for certain enums such as ResponseCodeEnum
and HederaFunctionality
, or should the SDKs hard-code a name?
We discussed about the issue in the hackathon today and have some questions about status and requestType. Before somebody work on the issues we should check if we can find a better solution. See https://github.com/hashgraph/hedera-sdk-java/issues/2040
๐๐ฅ First Timers Only
This issue is reserved for people who have never contributed to Hedera or any open source project in general. We know that creating a pull request (PR) is a major barrier for new contributors. The goal of this issue and all other issues labeled by 'good first issue' is to help you make your first contribution to Hedera.
๐พ Description of the issue
Problem
Currently, both Status.js and RequestType.js must be manually updated whenever new statuses or request types are introduced. While tools and scripts can streamline this process, it still requires manual execution and oversight. In particular, files like Status.js are prone to human error when manually updating the various status codes and response codes associated with Hedera transactions. Automating this process would eliminate the need for human intervention, ensure accuracy, and save time when new statuses or request types are added to the Hedera system.
For example, Status.js currently contains manually hardcoded status codes:
Here are examples for manually adding the statuses: Example 1 Example 2 Example 3
If a new status code is introduced in the Hedera protobuf definitions, this file would need to be manually updated to reflect that change.
Solution
Automate the generation or updating of Status.js and RequestType.js by connecting the process directly to the Hedera protobuf definitions. This way, whenever new status codes or request types are introduced in the protobuf schema, the corresponding JavaScript files will be automatically updated or regenerated. This could be done by writing a script that parses the protobuf definitions and generates the JavaScript constants, ensuring that all relevant status codes and request types are always up-to-date.
Steps to Implement
Additional Context
Given that Hedera is tightly integrated with protobuf, having the ability to pull in new status codes from the protobuf schema directly into the JavaScript files would ensure consistency across the ecosystem, especially during frequent updates.
Affected Environment
Hedera SDK Version: Any Operating System: Platform-independent (process needs to work across all environments)
๐ Step by step guide to do a contribution
If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. More information and concrete samples for shell commands for each step can be found in our CONTRIBUTING.md file. A more detailed general documentation of the GitHub PR workflow can be found here.
sign-off
information to the commit to accept the "Developer Certificate of Origin" (https://developercertificate.org). More details can be found in our CONTRIBUTING.md๐ Contribute to Hacktoberfest
Solve this issue as part of the Hacktoberfest event and get a chance to receive cool goodies like a T-Shirt. ๐ฝ
๐ค Additional Information
If you have any questions, just ask us directly in this issue by adding a comment. You can join our community chat at Discord. A general manual about open-source contributions can be found here.