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 api methods - aggregate changes into main branch #63

Merged
merged 5 commits into from
Jul 20, 2024

Conversation

lealobanov
Copy link
Collaborator

@lealobanov lealobanov commented Jul 16, 2024

Description

Pulls in changes from #61 to main


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Summary by CodeRabbit

  • New Features

    • Introduced methods for retrieving transactions, transaction results, and execution results by block ID in the Flow Access API.
    • Added new data classes (FlowChunk, FlowServiceEvent, FlowExecutionResult) for detailed execution result handling.
  • Tests

    • Implemented comprehensive test cases for new transaction and execution result retrieval methods by block ID.

Copy link
Contributor

coderabbitai bot commented Jul 16, 2024

Walkthrough

The recent update to the Flow SDK introduces new methods for retrieving transactions, transaction results, and execution results by block ID. Both synchronous and asynchronous versions of these methods have been added to their respective interfaces and implementations. Additionally, new data models for handling execution results, service events, and data chunks have been introduced. Comprehensive tests have been included to validate these new functionalities, ensuring robustness and reliability.

Changes

Files Change Summary
src/main/kotlin/org/onflow/flow/sdk/AsyncFlowAccessApi.kt Added asynchronous methods for retrieving transactions, transaction results, and execution results by block ID.
src/main/kotlin/org/onflow/flow/sdk/FlowAccessApi.kt Added synchronous methods for retrieving transactions, transaction results, and execution results by block ID.
src/main/kotlin/org/onflow/flow/sdk/impl/... Implemented new methods in AsyncFlowAccessApiImpl and FlowAccessApiImpl for retrieving data by block ID.
src/main/kotlin/org/onflow/flow/sdk/models.kt Added new data classes FlowChunk, FlowServiceEvent, and FlowExecutionResult with conversion and comparison methods.
src/test/kotlin/org/onflow/flow/sdk/... Added and updated test cases for the new methods to ensure coverage for transactions, results retrieval by block ID, and handling of various scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AsyncFlowAccessApi
    participant FlowAccessApiImpl
    participant FlowBlockchain

    Note over Client,AsyncFlowAccessApi: Asynchronous API call to get transactions by block ID

    Client->>AsyncFlowAccessApi: getTransactionsByBlockId(blockId)
    AsyncFlowAccessApi->>FlowAccessApiImpl: getTransactionsByBlockId(blockId)
    FlowAccessApiImpl->>FlowBlockchain: fetchTransactions(blockId)
    FlowBlockchain->>FlowAccessApiImpl: List<FlowTransaction>
    FlowAccessApiImpl->>AsyncFlowAccessApi: List<FlowTransaction>
    AsyncFlowAccessApi->>Client: CompletableFuture<List<FlowTransaction>>

    Note over Client,FlowAccessApiImpl: Synchronous API call to get execution result by block ID

    Client->>FlowAccessApiImpl: getExecutionResultByBlockId(blockId)
    FlowAccessApiImpl->>FlowBlockchain: fetchExecutionResult(blockId)
    FlowBlockchain->>FlowAccessApiImpl: FlowExecutionResult
    FlowAccessApiImpl->>Client: FlowExecutionResult
Loading

Poem

In the world of Flow, data streams anew,
Transactions and results by block ID, in full view.
Asynchronous calls, so swift and bright,
Ensure our blockchain flows just right.
Chunks and events, neatly in place,
Our tests ensure there's not a trace misplaced.
🐇🔍✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Jul 16, 2024

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 26af3e0. ± Comparison against base commit 26af3e0.

♻️ This comment has been updated with latest results.

@lealobanov lealobanov changed the title Access api methods Access api methods - aggregate changes into main branch Jul 16, 2024
@lealobanov lealobanov marked this pull request as ready for review July 16, 2024 11:18
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7659fde and af4b17c.

Files selected for processing (8)
  • src/main/kotlin/org/onflow/flow/sdk/AsyncFlowAccessApi.kt (1 hunks)
  • src/main/kotlin/org/onflow/flow/sdk/FlowAccessApi.kt (1 hunks)
  • src/main/kotlin/org/onflow/flow/sdk/impl/AsyncFlowAccessApiImpl.kt (1 hunks)
  • src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt (1 hunks)
  • src/main/kotlin/org/onflow/flow/sdk/models.kt (1 hunks)
  • src/test/kotlin/org/onflow/flow/sdk/FlowAccessApiTest.kt (1 hunks)
  • src/test/kotlin/org/onflow/flow/sdk/impl/AsyncFlowAccessApiImplTest.kt (2 hunks)
  • src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt (2 hunks)
Additional context used
Learnings (6)
src/main/kotlin/org/onflow/flow/sdk/FlowAccessApi.kt (1)
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.
src/main/kotlin/org/onflow/flow/sdk/AsyncFlowAccessApi.kt (1)
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.
src/test/kotlin/org/onflow/flow/sdk/FlowAccessApiTest.kt (2)
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:122-130
Timestamp: 2024-07-03T12:37:31.319Z
Learning: In the `FlowAccessApiImpl` and `AsyncFlowAccessApiImpl` classes, the `transactionResultsList` is non-nullable, making the use of `.orEmpty()` redundant.
src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt (2)
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:122-130
Timestamp: 2024-07-03T12:37:31.319Z
Learning: In the `FlowAccessApiImpl` and `AsyncFlowAccessApiImpl` classes, the `transactionResultsList` is non-nullable, making the use of `.orEmpty()` redundant.
src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt (2)
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:122-130
Timestamp: 2024-07-03T12:37:31.319Z
Learning: In the `FlowAccessApiImpl` and `AsyncFlowAccessApiImpl` classes, the `transactionResultsList` is non-nullable, making the use of `.orEmpty()` redundant.
src/main/kotlin/org/onflow/flow/sdk/impl/AsyncFlowAccessApiImpl.kt (2)
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:122-130
Timestamp: 2024-07-03T12:37:31.319Z
Learning: In the `FlowAccessApiImpl` and `AsyncFlowAccessApiImpl` classes, the `transactionResultsList` is non-nullable, making the use of `.orEmpty()` redundant.
Additional comments not posted (30)
src/main/kotlin/org/onflow/flow/sdk/FlowAccessApi.kt (3)

57-57: New Method Added: getTransactionsByBlockId

This method appears correctly defined and follows the existing pattern of method signatures within the interface. The return type and parameters are consistent with the interface's design.


59-59: New Method Added: getTransactionResultsByBlockId

The method signature is consistent with the interface's design principles and correctly retrieves transaction results by block ID.


61-61: New Method Added: getExecutionResultByBlockId

This method is properly added to fetch execution results by block ID. The method signature aligns well with the existing structure of the interface.

src/main/kotlin/org/onflow/flow/sdk/AsyncFlowAccessApi.kt (3)

53-53: New Asynchronous Method Added: getTransactionsByBlockId

The method correctly returns a CompletableFuture with the expected response type, adhering to the asynchronous pattern of the interface.


55-55: New Asynchronous Method Added: getTransactionResultsByBlockId

This method is appropriately defined to handle asynchronous fetching of transaction results by block ID.


57-57: New Asynchronous Method Added: getExecutionResultByBlockId

The method signature is correct for asynchronous operations and returns a nullable FlowExecutionResult, which is a thoughtful design choice considering that execution results might not always be available.

src/test/kotlin/org/onflow/flow/sdk/FlowAccessApiTest.kt (5)

247-256: New Test Method: Test getTransactionsByBlockId

The test method is well-structured, mocking dependencies correctly and asserting the expected behavior. It ensures that the method returns the correct transactions for a given block ID.


259-278: New Test Method: Test getTransactionsByBlockId with multiple results

This test method effectively checks the scenario where multiple transactions are returned. It correctly asserts the size of the result and the equality of expected transactions.


281-290: New Test Method: Test getTransactionResultsByBlockId

The test setup and assertions are correct, ensuring that the method behaves as expected when fetching transaction results by block ID.


293-312: New Test Method: Test getTransactionResultsByBlockId with multiple results

This test method is comprehensive, checking for multiple transaction results and asserting their correctness and order.


315-324: New Test Method: Test getExecutionResultByBlockId

The test is well-implemented, covering the scenario of fetching an execution result by block ID and asserting the correct response.

src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt (2)

339-349: Implementation of getTransactionsByBlockId

The method implementation correctly handles the API call and maps the response to the expected type. The error handling is also appropriately managed.


352-362: Implementation of getTransactionResultsByBlockId

The method is implemented to fetch transaction results by block ID correctly. The mapping of the response and error handling are well executed.

src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt (4)

13-13: Added import for ExecutionResultOuterClass is appropriate.

This import is necessary for the new test methods that deal with execution results.


374-391: Review of new test method for execution results retrieval by block ID.

The test method correctly mocks the API response for execution results and asserts the expected outcome. The structure and logic are consistent with the existing test framework.


344-372: Review of new test methods for transaction results retrieval by block ID.

These tests are well-structured and ensure that the transaction results are fetched and asserted correctly. Similar to the previous comment, verify the use of .orEmpty() for transaction results.

Verification successful

Verification successful: No occurrences of .orEmpty() found in transaction results retrieval methods.

The search confirmed that the .orEmpty() method is not used in the FlowAccessApiImpl class or the associated test file. Thus, the concern about its usage is not applicable.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the use of `.orEmpty()` in transaction results retrieval methods.

# Test: Search for the use of `.orEmpty()` in the transaction results retrieval methods. Expect: No occurrences.
rg --type kotlin --context 5 $'.orEmpty()' src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt

Length of output: 109


Script:

#!/bin/bash
# Description: Verify the use of `.orEmpty()` in the FlowAccessApiImpl class.

# Test: Search for the use of `.orEmpty()` in the FlowAccessApiImpl class. Expect: No occurrences.
rg --type kotlin '.orEmpty()' src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt

Length of output: 93


314-342: Review of new test methods for transaction retrieval by block ID.

These tests appropriately mock the API responses and verify that the transactions are retrieved correctly. However, ensure that the use of .orEmpty() is avoided if the transactions list is non-nullable.

Verification successful

Verification successful: Non-nullable transactions list.

The getTransactionsByBlockId method in FlowAccessApiImpl uses the transactionsList directly without .orEmpty(), confirming it is treated as non-nullable.

  • src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt: getTransactionsByBlockId
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the use of `.orEmpty()` in transaction retrieval methods.

# Test: Search for the use of `.orEmpty()` in the transaction retrieval methods. Expect: No occurrences.
rg --type kotlin --context 5 $'.orEmpty()' src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt

Length of output: 109


Script:

#!/bin/bash
# Description: Verify the non-nullability of the transactions list in the getTransactionsByBlockId method.

# Step 1: Locate the implementation of the getTransactionsByBlockId method in the FlowAccessApiImpl class.
ast-grep --lang kotlin --pattern 'fun getTransactionsByBlockId($_) { $$$ }' > method_implementation.txt

# Step 2: Check the method implementation for the transactions list and its non-nullability.
cat method_implementation.txt | rg 'transactionsList'

Length of output: 131


Script:

#!/bin/bash
# Description: Locate and inspect the implementation of the getTransactionsByBlockId method in the FlowAccessApiImpl class.

# Step 1: Locate the implementation of the getTransactionsByBlockId method in the FlowAccessApiImpl class.
ast-grep --lang kotlin --pattern 'fun getTransactionsByBlockId($_) { $$$ }' src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt

Length of output: 139


Script:

#!/bin/bash
# Description: Locate and inspect the implementation of the getTransactionsByBlockId method across the entire codebase.

# Step 1: Locate the implementation of the getTransactionsByBlockId method across the entire codebase.
ast-grep --lang kotlin --pattern 'fun getTransactionsByBlockId($_) { $$$ }'

Length of output: 77


Script:

#!/bin/bash
# Description: Locate and inspect the implementation of the getTransactionsByBlockId method across the entire codebase.

# Step 1: Locate the implementation of the getTransactionsByBlockId method across the entire codebase.
rg 'fun getTransactionsByBlockId' -A 20

Length of output: 6353

src/main/kotlin/org/onflow/flow/sdk/models.kt (3)

678-736: Review of FlowChunk class: Properly implemented with necessary methods.

The FlowChunk class is well-implemented with all necessary properties and methods for a Kotlin data class. The of method correctly converts from gRPC types, and the equals and hashCode methods are properly overridden to handle all properties, ensuring correct behavior in collections and other contexts.


738-764: Review of FlowServiceEvent class: Well-formed with essential methods.

The FlowServiceEvent class is correctly implemented and includes all necessary methods for a Kotlin data class. The of method accurately converts from gRPC types, and the equals and hashCode methods are effectively overridden to handle the properties, ensuring accurate behavior in collections and other contexts.


766-780: Review of FlowExecutionResult class: Correctly integrates new features.

The FlowExecutionResult class is well-integrated with the new features, correctly handling lists of FlowChunk and FlowServiceEvent. The of method effectively converts from gRPC types, ensuring that all properties are correctly initialized. This class ties together the individual components of the execution result, facilitating easier access and manipulation of the data.

src/test/kotlin/org/onflow/flow/sdk/impl/AsyncFlowAccessApiImplTest.kt (8)

8-8: Approved new imports for enhanced testing capabilities.

The imports for assertThrows, ExecutionResultOuterClass, Executors, TimeUnit, and TimeoutException are necessary for the new test functionalities, including exception handling and asynchronous operations.

Also applies to: 15-15, 19-21


27-30: Approved addition of companion object for centralized test constants.

The BLOCK_ID_BYTES and PARENT_ID_BYTES constants are well-placed in a companion object, enhancing readability and maintainability of tests by centralizing mock data.


319-330: Approved test for getTransactionsByBlockId.

The test method is well-constructed, appropriately using mocks and assertions to verify that the getTransactionsByBlockId method processes and returns the expected results correctly.


332-347: Approved test for handling multiple transactions in getTransactionsByBlockId.

This test method effectively verifies that the method can handle multiple transactions correctly, using mocks and assertions appropriately.


349-360: Approved test for getTransactionResultsByBlockId.

The test method correctly simulates the API response for transaction results and uses assertions to verify the correctness of the functionality.


362-377: Approved comprehensive test for multiple transaction results in getTransactionResultsByBlockId.

This test method effectively ensures that multiple transaction results are handled correctly, using a consistent testing approach with appropriate mocks and assertions.


379-427: Approved detailed test for getExecutionResultByBlockId.

This test method is comprehensive, covering all aspects of execution results, including chunks and service events. It effectively uses mocks and assertions to ensure the functionality is correctly implemented.


429-444: Approved test for handling timeout exceptions in getTransactionsByBlockId.

This test method correctly simulates a timeout scenario and uses assertThrows to verify that a TimeoutException is appropriately thrown, demonstrating good practice in testing asynchronous operations.

src/main/kotlin/org/onflow/flow/sdk/impl/AsyncFlowAccessApiImpl.kt (2)

539-558: Review: getTransactionResultsByBlockId method implementation.

The structure and error handling in this method are well-implemented. The use of CompletableFuture for asynchronous operations is appropriate.

Like the previous method, verify if .orEmpty() is used unnecessarily with response.transactionResultsList, as indicated by previous learnings.

Skipped due to learnings
Learnt from: lealobanov
PR: onflow/flow-jvm-sdk#55
File: src/main/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImpl.kt:109-117
Timestamp: 2024-07-03T12:36:05.001Z
Learning: `transactionsList` in the `getTransactionsByBlockID` method of `FlowAccessApiImpl` is non-nullable, making the use of `.orEmpty()` redundant.

561-582: Review: getExecutionResultByBlockId method implementation.

The method is well-structured for fetching execution results by block ID. The handling of the nullable FlowExecutionResult is appropriate, ensuring that an error is returned when the execution result is not found.

Consider verifying the handling of null values and exceptions to ensure robustness.

Comment on lines +517 to +536
override fun getTransactionsByBlockId(id: FlowId): CompletableFuture<FlowAccessApi.AccessApiCallResponse<List<FlowTransaction>>> {
return try {
completableFuture(
try {
api.getTransactionsByBlockID(
Access.GetTransactionsByBlockIDRequest.newBuilder().setBlockId(id.byteStringValue).build()
)
} catch (e: Exception) {
return CompletableFuture.completedFuture(FlowAccessApi.AccessApiCallResponse.Error("Failed to get transactions by block ID", e))
}
).handle { response, ex ->
if (ex != null) {
FlowAccessApi.AccessApiCallResponse.Error("Failed to get transactions by block ID", ex)
} else {
FlowAccessApi.AccessApiCallResponse.Success(response.transactionsList.map { FlowTransaction.of(it) })
}
}
} catch (e: Exception) {
CompletableFuture.completedFuture(FlowAccessApi.AccessApiCallResponse.Error("Failed to get transactions by block ID", e))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Review: getTransactionsByBlockId method implementation.

This method correctly implements asynchronous fetching of transactions by block ID. The use of CompletableFuture and proper exception handling within the try-catch blocks is consistent with Java's asynchronous programming patterns.

However, ensure that .orEmpty() is not used unnecessarily when handling response.transactionsList, as per previous learnings indicating that the list is non-nullable.

@franklywatson franklywatson requested a review from jribbink July 17, 2024 16:46
@lealobanov lealobanov merged commit 26af3e0 into main Jul 20, 2024
1 of 3 checks passed
Copy link

Integration Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 26af3e0. ± Comparison against base commit 26af3e0.

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.

3 participants