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

refactor: refactoring Narg checks #12814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ameeetgaikwad
Copy link

@ameeetgaikwad ameeetgaikwad commented Jan 7, 2025

Related Issues

#12790

Proposed Changes

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

@rvagg
Copy link
Member

rvagg commented Jan 8, 2025

@ameeetgaikwad I think we need to be a bit more complete with this, have a look for instances of ctx.Args (specifically cctx.Args() usually but ctx.Args is a good shortening that should catch variations), and then walk back in the commands to see if there is a check there. Doing this in cli and doing a quick browse of the initial results I can see slash-consensus seems to need a check for 2 but doesn't have one. evm.go has its own custom error method (if argc := cctx.Args().Len(); argc != 1 {) which we probably should make consistent and use the IncorrectNumArgs function (I'm not sure there's a good reason to do it this way, seems like copypasta code to me). I've only looked through the first few files and haven't even touched miner or worker. It would be good here to be a bit more exhaustive than just fixing the obvious ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📌 Triage
Development

Successfully merging this pull request may close these issues.

2 participants