hashgraph / hedera-sdk-cpp

C++ SDK for Hedera
Apache License 2.0
16 stars 14 forks source link

`TransactionId` should not be regenerated if set manually by a user #652

Open rwalworth opened 8 months ago

rwalworth commented 8 months ago

🆕🐥 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

Currently, setting a Transaction's TransactionId does not impact the Transaction's ability to regenerate its TransactionId. However, looking at Java and Go SDKs, the TransactionId gets locked when it is set manually. Then, when the Transaction is determining if it should regenerate its TransactionId or not, it looks at the transaction ID regeneration policy as well as if the TransactionId is locked. If the TransactionId is locked (which it is if its set manually by a user), it does not regenerate.

Steps to reproduce

  1. Set a TransactionId for a Transaction.
  2. Attempt to submit the Transaction and have it expire.
  3. Observe the TransactionId get regenerated.

📋 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.

🎉 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.

Operating system

Other

Atharva1723 commented 2 weeks ago

Can I work on this issue?

Atharva1723 commented 2 days ago

The transaction id is referenced for which example or it is generic. Not sure what to do?

rwalworth commented 1 day ago

The transaction id is referenced for which example or it is generic. Not sure what to do?

How it works now, when a TransactionId is set by a user, the processing will still regenerate the TransactionId if the Transaction expires and mTransactionIdRegenerationPolicy is set to true. This is not desired behavior. If the TransactionId is set manually by the user (by calling setTransactionId()), it shouldn't be regenerated even if mTransactionIdRegenerationPolicy is set to true.