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

chore: move abci errors to baseapp #20756

Merged
merged 2 commits into from
Jun 25, 2024
Merged

chore: move abci errors to baseapp #20756

merged 2 commits into from
Jun 25, 2024

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Jun 24, 2024

Description

Closes: #12186

remove abci errors from types/errors and place them in baseapp and make them private. This is an attempt to reduce the public api of the repository


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Refactor

    • Improved project structure by relocating specific types and functions for better organization and maintainability.
    • Renamed several internal functions for consistency and clarity.
  • Documentation

    • Updated CHANGELOG.md to reflect changes in type relocations and function renaming.

These updates streamline the codebase, enhancing readability and future maintainability without impacting end-user functionality.

@tac0turtle tac0turtle requested a review from a team as a code owner June 24, 2024 08:37
Copy link
Contributor

coderabbitai bot commented Jun 24, 2024

Walkthrough

Walkthrough

The recent changes to the cosmos-sdk project reorganize error type definitions by relocating ResponseCheckTxWithEvents, ResponseExecTxResultWithEvents, and QueryResult from the types/errors package to baseapp/errors.go, making these types private. Additionally, various function calls in baseapp files have been updated to use these newly renamed private functions for improved modularization and error handling.

Changes

File/Path Change Summary
CHANGELOG.md Updated summary section to reflect the relocation and privatization of specific types.
baseapp/abci.go Renamed function calls for query handling and error handling.
baseapp/baseapp.go Modified deliverTx function to use the new private response function.
baseapp/errors.go Changed package name to baseapp and made response functions private by renaming them.

Sequence Diagram(s)

No sequence diagrams needed as the changes primarily involve code refactoring and renaming functions.

Assessment against linked issues

Objective Addressed Explanation
Clean up types/errors package and transition to using cosmossdk.io/errors (#12186)
Investigate if SDK-wide errors can be internalized or moved (#12186)

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
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: 6

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 600f774 and 4835065.

Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • baseapp/abci.go (14 hunks)
  • baseapp/baseapp.go (1 hunks)
  • baseapp/errors.go (3 hunks)
Additional context used
Path-based instructions (4)
baseapp/errors.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

baseapp/baseapp.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

baseapp/abci.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

CHANGELOG.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Markdownlint
CHANGELOG.md

72-72: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


73-73: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


77-77: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


78-78: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


79-79: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


80-80: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


85-85: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


129-129: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


130-130: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


131-131: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


135-135: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


138-138: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


139-139: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


140-140: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


147-147: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


157-157: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


159-159: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


162-162: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


181-181: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


182-182: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


184-184: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


185-185: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


238-238: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


239-239: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


240-240: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


404-404: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


407-407: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


429-429: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


430-430: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


443-443: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


475-475: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


476-476: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


477-477: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


478-478: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


480-480: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


481-481: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


482-482: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


483-483: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


497-497: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


499-499: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


501-501: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


503-503: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


506-506: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


507-507: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


508-508: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


516-516: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


517-517: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


519-519: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


520-520: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


522-522: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


523-523: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


524-524: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


526-526: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


527-527: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


535-535: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


546-546: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


547-547: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


548-548: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


554-554: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


555-555: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


556-556: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


562-562: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


578-578: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


579-579: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


580-580: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


581-581: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


582-582: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


583-583: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


588-588: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


589-589: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


590-590: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


591-591: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


598-598: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


599-599: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


600-600: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


634-634: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


635-635: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


636-636: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


637-637: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


642-642: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


643-643: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


791-791: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


934-934: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


955-955: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


958-958: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1040-1040: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1041-1041: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1042-1042: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1043-1043: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1044-1044: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1045-1045: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1142-1142: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1228-1228: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1274-1274: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1280-1280: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1281-1281: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1282-1282: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1283-1283: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1284-1284: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1285-1285: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1385-1385: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1510-1510: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1511-1511: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1512-1512: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1513-1513: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1514-1514: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1515-1515: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1516-1516: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1517-1517: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1520-1520: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1521-1521: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1522-1522: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1523-1523: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1524-1524: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1525-1525: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


1774-1774: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1775-1775: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1776-1776: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1777-1777: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1778-1778: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1779-1779: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


1889-1889: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2226-2226: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2227-2227: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2228-2228: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2231-2231: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2232-2232: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2233-2233: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2255-2255: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2256-2256: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2257-2257: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2258-2258: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2259-2259: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2267-2267: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2268-2268: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2269-2269: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2270-2270: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2271-2271: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2273-2273: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2274-2274: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2275-2275: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2602-2602: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2603-2603: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2604-2604: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2605-2605: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2606-2606: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2608-2608: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2610-2610: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2611-2611: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2612-2612: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2613-2613: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2614-2614: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2615-2615: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2617-2617: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2618-2618: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2619-2619: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2622-2622: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2623-2623: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2624-2624: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2625-2625: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2626-2626: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2629-2629: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2632-2632: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2635-2635: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2636-2636: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2639-2639: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2646-2646: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2647-2647: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2648-2648: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2649-2649: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2650-2650: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2652-2652: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2653-2653: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2654-2654: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2655-2655: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2656-2656: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2657-2657: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2658-2658: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2659-2659: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2660-2660: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2663-2663: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2664-2664: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2665-2665: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2666-2666: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2667-2667: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2668-2668: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2675-2675: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2676-2676: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2677-2677: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2678-2678: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2685-2685: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2687-2687: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2689-2689: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2690-2690: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2691-2691: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2692-2692: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2693-2693: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2694-2694: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2695-2695: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2696-2696: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2697-2697: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2698-2698: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2699-2699: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2700-2700: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2701-2701: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2702-2702: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2703-2703: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2704-2704: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2705-2705: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2706-2706: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2707-2707: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2708-2708: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2709-2709: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2710-2710: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2711-2711: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2712-2712: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2713-2713: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2714-2714: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2715-2715: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2717-2717: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2718-2718: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2720-2720: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2721-2721: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2722-2722: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2723-2723: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2724-2724: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2725-2725: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2726-2726: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2729-2729: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2730-2730: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2732-2732: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2733-2733: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2736-2736: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2737-2737: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2738-2738: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2739-2739: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2740-2740: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2741-2741: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2742-2742: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2743-2743: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2745-2745: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2746-2746: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2747-2747: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2753-2753: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2756-2756: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2762-2762: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2770-2770: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2771-2771: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2772-2772: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2773-2773: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2781-2781: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2788-2788: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2789-2789: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2796-2796: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2798-2798: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2802-2802: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2803-2803: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2805-2805: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2813-2813: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2815-2815: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2816-2816: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2822-2822: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2830-2830: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2831-2831: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2832-2832: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2833-2833: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2834-2834: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2835-2835: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2836-2836: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2837-2837: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2838-2838: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2839-2839: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2840-2840: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2841-2841: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2842-2842: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2843-2843: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2845-2845: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2846-2846: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2848-2848: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2849-2849: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2850-2850: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2851-2851: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2852-2852: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2853-2853: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2854-2854: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2855-2855: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2856-2856: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2857-2857: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2859-2859: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2860-2860: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2863-2863: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2864-2864: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2865-2865: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2866-2866: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2867-2867: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2868-2868: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2869-2869: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2870-2870: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2871-2871: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2872-2872: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2873-2873: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2874-2874: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2875-2875: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2876-2876: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2877-2877: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2878-2878: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2883-2883: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2884-2884: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2885-2885: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2886-2886: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2887-2887: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2888-2888: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2890-2890: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2892-2892: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2906-2906: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2907-2907: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2908-2908: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2913-2913: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2914-2914: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2915-2915: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2919-2919: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2920-2920: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2921-2921: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2922-2922: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2923-2923: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2924-2924: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2927-2927: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2928-2928: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2929-2929: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2930-2930: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2931-2931: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2932-2932: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2933-2933: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2934-2934: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2935-2935: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2937-2937: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2939-2939: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2941-2941: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2946-2946: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2947-2947: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2948-2948: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2949-2949: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2950-2950: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2951-2951: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2952-2952: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2953-2953: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2954-2954: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2955-2955: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2956-2956: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2957-2957: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2958-2958: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2959-2959: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2960-2960: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2961-2961: Expected: 4; Actual: 8 (MD007, ul-indent)
Unordered list indentation


2962-2962: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2963-2963: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2964-2964: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2965-2965: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


2966-2966: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation


191-191: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


235-235: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


1144-1144: null (MD024, no-duplicate-heading)
Multiple headings with the same content


1934-1934: null (MD024, no-duplicate-heading)
Multiple headings with the same content


1692-1692: null (MD034, no-bare-urls)
Bare URL used


1722-1722: null (MD034, no-bare-urls)
Bare URL used


2669-2669: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2757-2757: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2759-2759: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2764-2764: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2766-2766: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2776-2776: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2778-2778: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2783-2783: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2791-2791: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2808-2808: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2810-2810: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2818-2818: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2824-2824: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2894-2894: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2897-2897: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2900-2900: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2902-2902: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


2942-2942: null (MD037, no-space-in-emphasis)
Spaces inside emphasis markers


1063-1063: null (MD038, no-space-in-code)
Spaces inside code span elements


2710-2710: null (MD038, no-space-in-code)
Spaces inside code span elements


2710-2710: null (MD038, no-space-in-code)
Spaces inside code span elements

Additional comments not posted (5)
baseapp/errors.go (4)

1-1: Package name changed to baseapp.

Changing the package name from errors to baseapp aligns with the PR's goal to encapsulate the error handling within the baseapp package. This helps in reducing the public API surface.


9-11: Function responseCheckTxWithEvents has been made private.

The function has been renamed from ResponseCheckTxWithEvents to responseCheckTxWithEvents, making it private. This change is in line with encapsulating error handling within baseapp. The function's implementation remains unchanged, ensuring that existing functionality is preserved.


23-25: Function responseExecTxResultWithEvents has been made private.

Similar to the previous function, responseExecTxResultWithEvents has been renamed from its public counterpart to restrict its access within the package. This is a good practice for encapsulating functionality that does not need to be exposed externally.


37-39: Function queryResult has been made private.

Renaming QueryResult to queryResult effectively makes it private, which is consistent with the encapsulation strategy of this PR. The function's logic remains intact, which should prevent any functional regressions.

baseapp/baseapp.go (1)

767-767: Function call updated to use the newly private function.

The deliverTx function now correctly calls responseExecTxResultWithEvents instead of the previous public function. This change is part of the broader encapsulation effort and is correctly implemented here.

@@ -191,6 +191,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (client) [#20255](https://github.com/cosmos/cosmos-sdk/pull/20255) Use comet proofOp proto type instead of sdk version to avoid needing to translate to later be proven in the merkle proof runtime.
* (all) [#19726](https://github.com/cosmos/cosmos-sdk/pull/19726) Integrate comet v1
* (client) [#20616](https://github.com/cosmos/cosmos-sdk/pull/20616) gentx subcommand output goes to `cmd.ErrOrStderr()` instead of being hardcoded to `os.Stderr`
* (types/errors) [#20756](https://github.com/cosmos/cosmos-sdk/pull/20756) Remove `ResponseCheckTxWithEvents`, `ResponseExecTxResultWithEvents` & `QueryResult` from types/errors pkg. They have been moved to `baseapp/errors.go` and made private
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix trailing spaces in the CHANGELOG entry.

There's a markdown lint issue due to trailing spaces at the end of the entry. It's important to adhere to markdown best practices to maintain the quality of the documentation.

- * (types/errors) [#20756](https://github.com/cosmos/cosmos-sdk/pull/20756) Remove `ResponseCheckTxWithEvents`, `ResponseExecTxResultWithEvents` & `QueryResult` from types/errors pkg. They have been moved to `baseapp/errors.go` and made private 
+ * (types/errors) [#20756](https://github.com/cosmos/cosmos-sdk/pull/20756) Remove `ResponseCheckTxWithEvents`, `ResponseExecTxResultWithEvents` & `QueryResult` from types/errors pkg. They have been moved to `baseapp/errors.go` and made private
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* (types/errors) [#20756](https://github.com/cosmos/cosmos-sdk/pull/20756) Remove `ResponseCheckTxWithEvents`, `ResponseExecTxResultWithEvents` & `QueryResult` from types/errors pkg. They have been moved to `baseapp/errors.go` and made private
* (types/errors) [#20756](https://github.com/cosmos/cosmos-sdk/pull/20756) Remove `ResponseCheckTxWithEvents`, `ResponseExecTxResultWithEvents` & `QueryResult` from types/errors pkg. They have been moved to `baseapp/errors.go` and made private

@@ -166,7 +166,7 @@ func (app *BaseApp) Query(_ context.Context, req *abci.QueryRequest) (resp *abci
// Ref: https://github.com/cosmos/cosmos-sdk/pull/8039
defer func() {
if r := recover(); r != nil {
resp = sdkerrors.QueryResult(errorsmod.Wrapf(sdkerrors.ErrPanic, "%v", r), app.trace)
resp = queryResult(errorsmod.Wrapf(sdkerrors.ErrPanic, "%v", r), app.trace)
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor to use a more descriptive error message.

The error message in queryResult could be more descriptive to provide better context about the error.

- resp = queryResult(errorsmod.Wrapf(sdkerrors.ErrPanic, "%v", r), app.trace)
+ resp = queryResult(errorsmod.Wrapf(sdkerrors.ErrPanic, "Query recovery from panic: %v", r), app.trace)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
resp = queryResult(errorsmod.Wrapf(sdkerrors.ErrPanic, "%v", r), app.trace)
resp = queryResult(errorsmod.Wrapf(sdkerrors.ErrPanic, "Query recovery from panic: %v", r), app.trace)

@@ -206,7 +206,7 @@
resp = handleQueryP2P(app, path)

default:
resp = sdkerrors.QueryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "unknown query path"), app.trace)
resp = queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "unknown query path"), app.trace)
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve error message for unknown paths.

The error message could be more informative by suggesting possible correct paths.

- resp = queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "unknown query path"), app.trace)
+ resp = queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "Unknown query path. Please refer to the documentation for supported paths."), app.trace)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
resp = queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "unknown query path"), app.trace)
resp = queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "Unknown query path. Please refer to the documentation for supported paths."), app.trace)

@@ -191,7 +191,7 @@

path := SplitABCIQueryPath(req.Path)
if len(path) == 0 {
return sdkerrors.QueryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"), app.trace), nil
return queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"), app.trace), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve error message for better user guidance.

The error message "no query path provided" could provide guidance on what paths are expected.

- return queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"), app.trace), nil
+ return queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "No query path provided. Please specify a valid query path."), app.trace), nil
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"), app.trace), nil
return queryResult(errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "No query path provided. Please specify a valid query path."), app.trace), nil

@@ -180,7 +180,7 @@
defer telemetry.MeasureSince(telemetry.Now(), req.Path)

if req.Path == QueryPathBroadcastTx {
return sdkerrors.QueryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil
return queryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider improving error message clarity.

The error message "can't route a broadcast tx message" could be more specific to explain why the routing cannot be done.

- return queryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil
+ return queryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "BroadcastTx messages are not supported in this context"), app.trace), nil
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return queryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil
return queryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "BroadcastTx messages are not supported in this context"), app.trace), nil

@@ -365,7 +365,7 @@

gInfo, result, anteEvents, err := app.runTx(mode, req.Tx)
if err != nil {
return sdkerrors.ResponseCheckTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, anteEvents, app.trace), nil
return responseCheckTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, anteEvents, app.trace), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent use of responseCheckTxWithEvents for error handling.

The function responseCheckTxWithEvents is not used consistently across similar contexts for error handling. Here are some instances where responses are returned directly without using responseCheckTxWithEvents:

  • server/v2/cometbft/utils.go
  • baseapp/abci.go

Please ensure that responseCheckTxWithEvents is used uniformly for consistency in error handling.

Analysis chain

Ensure consistency in error handling.

The function responseCheckTxWithEvents is used here for error handling. Ensure that it is used consistently across similar contexts for error handling to maintain uniformity.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify consistent use of `responseCheckTxWithEvents` across similar contexts.

# Test: Search for `responseCheckTxWithEvents` usage. Expect: Consistent usage in similar error handling contexts.
rg --type go 'responseCheckTxWithEvents'

Length of output: 396



Script:

#!/bin/bash
# Description: Retrieve the definition of `responseCheckTxWithEvents` to understand its purpose and usage.

# Extract the function definition of `responseCheckTxWithEvents` from baseapp/errors.go
ast-grep --lang go --pattern 'func responseCheckTxWithEvents($_, $_, $_, $_, $_) $_ { $$$ }' baseapp/errors.go

Length of output: 112



Script:

#!/bin/bash
# Description: Retrieve the definition of `responseCheckTxWithEvents` to understand its purpose and usage.

# Search for the function definition of `responseCheckTxWithEvents` in baseapp/errors.go and extract the relevant lines.
rg 'func responseCheckTxWithEvents' baseapp/errors.go -A 20

Length of output: 807



Script:

#!/bin/bash
# Description: Verify consistent use of `responseCheckTxWithEvents` across similar contexts.

# Search for functions that handle errors and return responses in the codebase.
rg --type go 'return &abci\.(CheckTxResponse|ExecTxResult)' -A 5

Length of output: 1267

@tac0turtle tac0turtle added this pull request to the merge queue Jun 25, 2024
Merged via the queue into main with commit aceeaf4 Jun 25, 2024
67 of 69 checks passed
@tac0turtle tac0turtle deleted the marko/12186 branch June 25, 2024 10:08
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.

Future of types/errors package and sdk-wide errors
4 participants