babylonlabs-io / babylonlabs-io/babylon
feat: Add ValidateBasic() for tx messages
- Dominant language
- Go
- Stars
- 101
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Several module message types are missing `ValidateBasic()` validation. This method is crucial for performing basic stateless checks before messages reach the handler, helping to catch invalid messages early.
## Problem Definition
- Improved message validation
- Catch invalid messages early
- Consistent with Cosmos SDK best practices
- Enhanced code maintainability
## Proposal
Add `ValidateBasic()` implementation for each message type to validate:
- Required fields are not empty/zero
- Field formats are correct (e.g., valid addresses, heights, etc.)
- Basic logical constraints are met
Contributor guide
Research direction
Start by locating the module message types that lack ValidateBasic() implementations. Review existing Cosmos SDK validation patterns, then add checks for required fields, valid formats, and basic logical constraints for each affected message; done means every targeted message validates invalid input before reaching its handler.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100