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

We need custom validators from go command line validation #1767

Closed
tjayrush opened this issue Sep 25, 2021 · 1 comment
Closed

We need custom validators from go command line validation #1767

tjayrush opened this issue Sep 25, 2021 · 1 comment
Assignees

Comments

@tjayrush
Copy link
Member

See this issue: spf13/cobra#745.

We would like to use this method (composing validators) in our auto-generated code, but we need some more custom validators. Four immediate validators would be:

  • IsValidAddress
    • 42 characters long
    • starts with 0x
    • hexidecimal
  • IsValidHash
    • 66 characters long
    • starts with 0x
    • hexidecimal
  • IsValidBlockIdentifier
    • uint64
    • IsValidHash
    • named block
  • IsValidTransactionIdentifier
    • .uint64
    • IsValidHash
    • named block.uint64
    • .*

Do not call into the RPC for any of this first level validation. The called-into routines can do deeper validation (i.e. is this even a valid block?) when they're called because they must use RPC anyway to fulfill the request.

@tjayrush
Copy link
Member Author

tjayrush commented Oct 7, 2021

We're well on our way with the new block range parsing. This will happen naturally.

@tjayrush tjayrush closed this as completed Oct 7, 2021
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

No branches or pull requests

2 participants