sei-chain icon indicating copy to clipboard operation
sei-chain copied to clipboard

Add more checks `ValidateBasic` message method

Open lumtis opened this issue 3 years ago • 2 comments

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

lumtis avatar Jul 12 '22 14:07 lumtis

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

faddat avatar Jul 12 '22 16:07 faddat

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

lumtis avatar Jul 12 '22 20:07 lumtis

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 avatar May 05 '23 18:05 LCyson