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

Add example on how to generate transaction IDs on demand and scenarios #1860

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

petreze
Copy link
Contributor

@petreze petreze commented Sep 8, 2023

Description:
Add example on how to generate transaction IDs on demand and two scenarios where this approach is useful
Scenarios:

Scenario 1:
Sometimes, when you are trying to execute transactions `asynchronosly`,
there is a tiny bit of chance to generate the same `transactionId` given the same `accountId`
and the current timestamp.
With the following approach to generate custom `transactionId`, this issue is avoided

Scenario 2:
The `TransactionId` object contains the valid start time for the transaction. This means that
by setting the valid start time to a moment in the future, you would be able to execute the transaction
after the set period (in seconds)

Related issue(s):

Fixes #1319

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@sonarcloud
Copy link

sonarcloud bot commented Sep 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@petreze petreze merged commit 2b53502 into develop Sep 8, 2023
9 of 10 checks passed
@petreze petreze deleted the example/add-txid-on-demand branch September 8, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example that demonstrates the use of generating transaction IDs on demand
2 participants