Skip to content

refactor: remove redundant err checks#3347

Open
yasyzb wants to merge 1 commit into
dydxprotocol:mainfrom
yasyzb:fix/remove-redundant-err-checks
Open

refactor: remove redundant err checks#3347
yasyzb wants to merge 1 commit into
dydxprotocol:mainfrom
yasyzb:fix/remove-redundant-err-checks

Conversation

@yasyzb

@yasyzb yasyzb commented Jun 11, 2026

Copy link
Copy Markdown

Changelist

Removed redundant if err != nil checks from protocol/scripts/vault/get_vault.go and protocol/x/sending/client/cli/tx_create_transfer.go that were checking for errors when none could have been produced by the preceding line.

Test Plan

Code linting and compilation locally.

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • Refactor
    • Code cleanup and optimization in vault and transfer-related scripts to improve maintainability and reduce redundancy.

@yasyzb yasyzb requested a review from a team as a code owner June 11, 2026 09:52
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d49b864-4749-44ca-a79f-73c71b6c1515

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee9766 and 3999b12.

📒 Files selected for processing (2)
  • protocol/scripts/vault/get_vault.go
  • protocol/x/sending/client/cli/tx_create_transfer.go
💤 Files with no reviewable changes (2)
  • protocol/scripts/vault/get_vault.go
  • protocol/x/sending/client/cli/tx_create_transfer.go

📝 Walkthrough

Walkthrough

Redundant error-checking blocks are removed from two files. In the vault script, an unnecessary error check after vaultId construction is deleted. In the sending transaction CLI, a redundant error check after parsing quantums is removed. Both deletions simplify control flow without functional changes.

Changes

Redundant Error Check Cleanup

Layer / File(s) Summary
Remove redundant error handling blocks
protocol/scripts/vault/get_vault.go, protocol/x/sending/client/cli/tx_create_transfer.go
Redundant if err != nil blocks are deleted from the vault script (after vaultId construction) and transaction CLI (after parsing quantums), allowing execution to proceed directly to subsequent operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

protocol

Suggested reviewers

  • vincentwschau
  • tqin7

Poem

🐰 The vault and transfer streams now flow so clean,
With redundant checks removed from the scene.
Error paths uncluttered, code light as a breeze,
v4-chain hops onward with newfound ease!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: remove redundant err checks' clearly and concisely describes the main change in the changeset.
Description check ✅ Passed The PR description follows the required template structure with Changelist, Test Plan, and Author/Reviewer Checklist sections, all properly completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant