-
Notifications
You must be signed in to change notification settings - Fork 180
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] Implement subscribe transaction statuses by transaction ID #6737
base: master
Are you sure you want to change the base?
Changes from 21 commits
ed80a0c
103d15d
4b7275b
5ede502
80b63eb
c1dc45a
0f1ad0d
e53c356
93c69c1
a162ba2
383b7e8
7184c8e
725ccda
25493da
733a485
1170a55
b427e33
03c5be5
d1d0466
4aa5d14
52bc521
65a0757
fd4afd1
b291085
a3f45e1
fa5f03f
a51b1fb
02e1d83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -203,10 +203,50 @@ type API interface { | |||||||||||||||||
// | ||||||||||||||||||
// If invalid parameters will be supplied SubscribeBlockDigestsFromLatest will return a failed subscription. | ||||||||||||||||||
SubscribeBlockDigestsFromLatest(ctx context.Context, blockStatus flow.BlockStatus) subscription.Subscription | ||||||||||||||||||
// SubscribeTransactionStatuses streams transaction statuses starting from the reference block saved in the | ||||||||||||||||||
// transaction itself until the block containing the transaction becomes sealed or expired. When the transaction | ||||||||||||||||||
// status becomes TransactionStatusSealed or TransactionStatusExpired, the subscription will automatically shut down. | ||||||||||||||||||
SubscribeTransactionStatuses(ctx context.Context, tx *flow.TransactionBody, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription | ||||||||||||||||||
// SubscribeTransactionStatusesFromStartBlockID subscribes to transaction status updates for a given transaction ID. | ||||||||||||||||||
// Monitoring begins from the specified block ID. The subscription streams status updates until the transaction | ||||||||||||||||||
// reaches a final state (TransactionStatusSealed or TransactionStatusExpired). When the transaction reaches one of | ||||||||||||||||||
// these final statuses, the subscription will automatically terminate. | ||||||||||||||||||
// | ||||||||||||||||||
// Parameters: | ||||||||||||||||||
// - ctx: The context to manage the subscription's lifecycle, including cancellation. | ||||||||||||||||||
// - txID: The identifier of the transaction to monitor. | ||||||||||||||||||
// - startBlockID: The block ID from which to start monitoring. | ||||||||||||||||||
// - requiredEventEncodingVersion: The version of event encoding required for the subscription. | ||||||||||||||||||
SubscribeTransactionStatusesFromStartBlockID(ctx context.Context, txID flow.Identifier, startBlockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
To me it seems that "Start" can be omitted but that is just a preference for shorter function names. |
||||||||||||||||||
// SubscribeTransactionStatusesFromStartHeight subscribes to transaction status updates for a given transaction ID. | ||||||||||||||||||
// Monitoring begins from the specified block height. The subscription streams status updates until the transaction | ||||||||||||||||||
// reaches a final state (TransactionStatusSealed or TransactionStatusExpired). When the transaction reaches one of | ||||||||||||||||||
// these final statuses, the subscription will automatically terminate. | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
// | ||||||||||||||||||
// Parameters: | ||||||||||||||||||
// - ctx: The context to manage the subscription's lifecycle, including cancellation. | ||||||||||||||||||
// - txID: The unique identifier of the transaction to monitor. | ||||||||||||||||||
// - startHeight: The block height from which to start monitoring. | ||||||||||||||||||
// - requiredEventEncodingVersion: The version of event encoding required for the subscription. | ||||||||||||||||||
SubscribeTransactionStatusesFromStartHeight(ctx context.Context, txID flow.Identifier, startHeight uint64, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
// SubscribeTransactionStatusesFromLatest subscribes to transaction status updates for a given transaction ID. | ||||||||||||||||||
// Monitoring begins from the latest block. The subscription streams status updates until the transaction | ||||||||||||||||||
// reaches a final state (TransactionStatusSealed or TransactionStatusExpired). When the transaction reaches one of | ||||||||||||||||||
// these final statuses, the subscription will automatically terminate. | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
// | ||||||||||||||||||
// Parameters: | ||||||||||||||||||
// - ctx: The context to manage the subscription's lifecycle, including cancellation. | ||||||||||||||||||
// - txID: The unique identifier of the transaction to monitor. | ||||||||||||||||||
// - requiredEventEncodingVersion: The version of event encoding required for the subscription. | ||||||||||||||||||
SubscribeTransactionStatusesFromLatest(ctx context.Context, txID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription | ||||||||||||||||||
// SendAndSubscribeTransactionStatuses sends a transaction to the execution node and subscribes to its status updates. | ||||||||||||||||||
// Monitoring begins from the reference block saved in the transaction itself and streams status updates until the transaction | ||||||||||||||||||
// reaches a final state (TransactionStatusSealed or TransactionStatusExpired). Once a final status is reached, the subscription | ||||||||||||||||||
// automatically terminates. | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
// | ||||||||||||||||||
// Parameters: | ||||||||||||||||||
// - ctx: The context to manage the transaction sending and subscription lifecycle, including cancellation. | ||||||||||||||||||
// - tx: The transaction body to be sent and monitored. | ||||||||||||||||||
// - requiredEventEncodingVersion: The version of event encoding required for the subscription. | ||||||||||||||||||
// | ||||||||||||||||||
// If the transaction cannot be sent, the subscription will fail and return a failed subscription. | ||||||||||||||||||
SendAndSubscribeTransactionStatuses(ctx context.Context, tx *flow.TransactionBody, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
// TODO: Combine this with flow.TransactionResult? | ||||||||||||||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.