Automatically generate/update Status.js
and RequestType.js
#1145
Labels
enhancement
New feature or request
good first issue
Issues which are ideal for a first time or new project contributor.
hacktoberfest
Issues shown by lists for the Hacktoberfest and made for newcomers to do the first contribution.
p3
🆕🐥 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.
The text was updated successfully, but these errors were encountered: