Skip to content

Conversation

@peterargue
Copy link
Contributor

This PR add support for querying scheduled and system transactions using the existing /transactions/{id} and /transaction_results/{id} endpoints.

@peterargue peterargue requested a review from a team as a code owner October 18, 2025 00:03
}

for _, tt := range tests {
func TestBenchmarkURLToRoute(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the new version completes ~25% faster (1.15s vs 1.55s)

Copy link
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv left a comment

Choose a reason for hiding this comment

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

LGTM!

return err
}

type GetScheduledTransaction struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add small godoc for GetScheduledTransaction, GetScheduledTransactionResult and its constructors?

return response, nil
}

func isTransactionID(raw string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please a couple of words to the godoc for isTransactionID?

})
}

func TestGetScheduledTransactions(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests look good overall! The only things I’d suggest are adding godocs for the test functions and helpers, and using .Once() to verify backend mock calls.

Copy link
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

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

Looks good - just a few minor documentation-related suggestions


const idQuery = "id"

// GetTransactionByID gets a transaction by requested ID.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// GetTransactionByID gets a transaction by requested ID.
// GetTransactionByID gets a transaction by requested ID.
// The ID may be either:
// 1. the hex-encoded 32-byte hash of a user-submitted transaction, or
// 2. the integral system-assigned identifier of a scheduled transaction

return response, nil
}

// GetTransactionResultByID retrieves transaction result by the transaction ID.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// GetTransactionResultByID retrieves transaction result by the transaction ID.
// GetTransactionResultByID retrieves transaction result by the transaction ID.
// The ID may be either:
// 1. the hex-encoded 32-byte hash of a user-submitted transaction, or
// 2. the integral system-assigned identifier of a scheduled transaction

Comment on lines +138 to +140
// isTransactionID returns true if the provided string is a valid flow.Identifier indicating it is a
// transaction ID.
func isTransactionID(raw string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// isTransactionID returns true if the provided string is a valid flow.Identifier indicating it is a
// transaction ID.
func isTransactionID(raw string) bool {
// isTransactionID returns true if the provided string is a valid hex-encoded 32-byte flow.Identifier indicating it is a transaction ID.
// In particular, this method returns false if the input is a *scheduled transaction* ID.
func isTransactionID(raw string) bool {

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.

4 participants