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

[Access] Fix SendAndSubscribeTransactionStatuses and example #798

Conversation

Guitarheroua
Copy link
Contributor

Closes: #6604

Description

  • Implements an example of SendAndSubscribeTransactionStatuses on the testnet, as the emulator does not support subscriptions.
  • The messageIndex value has been fixed, as it should always start at 1.

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.47%. Comparing base (2f7fa8b) to head (ca1c052).
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #798      +/-   ##
==========================================
+ Coverage   56.59%   57.47%   +0.88%     
==========================================
  Files          35       35              
  Lines        7305     7454     +149     
==========================================
+ Hits         4134     4284     +150     
+ Misses       2670     2660      -10     
- Partials      501      510       +9     
Flag Coverage Δ
unittests 57.47% <100.00%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

serviceAcctAddr, serviceAcctKey, serviceSigner := examples.ServiceAccount(flowClient)
signerIndex := uint32(0)

signerPublicAddress := flow.HexToAddress("YOUR_ACCOUNT_ADDRESS")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this example work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it within the testnet, and yes, this is working.

@jribbink
Copy link
Contributor

jribbink commented Dec 3, 2024

In the same vein as @chasefleming 's comments.

For consistency purposes, it's probably best to follow the approach already used by the send transaction example here. In this example, the Flow Emulator is used and the signer is the emulator service account.

@peterargue
Copy link
Contributor

the issue here is that there are some AccessAPI endpoints that are missing from the emulator, which is why these changes were made. totally open to other options if you think there's a better way.

eventually we will update the emulator to add these endpoints, but there is no demand for it other than this test so far.

@jribbink
Copy link
Contributor

jribbink commented Dec 4, 2024

the issue here is that there are some AccessAPI endpoints that are missing from the emulator, which is why these changes were made. totally open to other options if you think there's a better way.

eventually we will update the emulator to add these endpoints, but there is no demand for it other than this test so far.

Gotcha, wasn't aware if this limitation 👍

@peterargue peterargue merged commit 64dfdc9 into onflow:master Dec 19, 2024
1 check passed
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.

Fix nil pointer dereference in SendAndSubscribeTransactionStatuses() func
5 participants