Skip to content

Add more checks ValidateBasic message method - #104

Closed
lubtd wants to merge 1 commit into
sei-protocol:masterfrom
lubtd:improve/validate-basic
Closed

lubtd wants to merge 1 commit into
sei-protocol:masterfrom
lubtd:improve/validate-basic

Conversation

@lubtd

@lubtd lubtd commented Jul 12, 2022

Copy link
Copy Markdown

ValidateBasic of sdk.Msg allows performing static checks for an sdk message.
These checks are performed before the message is broadcast to the network, therefore it is more optimized to have these checks in ValidateBasic rather that in the message handler to save gas for txs bound to fail.

This PR adds some more checks in message validate basic like contract address check or coins validity checks

@faddat

faddat commented Jul 12, 2022

Copy link
Copy Markdown
Contributor

Super awesome! I just approved the CI for this and thanks so much for this PR.

@lubtd

lubtd commented Jul 12, 2022

Copy link
Copy Markdown
Author

Sure!

Some message also defines accountToLiquidate where bech32 format could be checked as well. But I wasn't 100% sure this represent an account address

@BrandonWeng
BrandonWeng requested a review from LCyson May 4, 2023 15:34
@BrandonWeng
BrandonWeng requested a review from Kbhat1 May 4, 2023 15:34
@BrandonWeng BrandonWeng added the enhancement New feature or request label May 4, 2023
@LCyson

LCyson commented May 5, 2023

Copy link
Copy Markdown
Contributor

Thanks for this PR ser (and sry for the delay)! There were a few other features added to the x/dex module since last year and the checks have been added to message_place_orders and message_cancel_orders since then. I'm going to close this PR but def send a github issue or PR if there is any other missing piece to the module!

@LCyson LCyson closed this May 5, 2023
masih pushed a commit that referenced this pull request Sep 29, 2025
## Describe your changes and provide context
Used in unit tests in sei-chain 

## Testing performed to validate your change
masih pushed a commit that referenced this pull request Sep 30, 2025
## Describe your changes and provide context
Used in unit tests in sei-chain 

## Testing performed to validate your change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants