1

I want to validate the extrinsic string parameters like name, title, cid, etc. The type should be capable of min/max length validation. And checking the lower bound is impossible with the current implementation of frame_support::BoundedVec. But BoundedVec from std library has a lower bound functionality.

It's more of a suggestion for a Substrate team. I assume the only way is a custom type with all of the serialization rules. Maybe other suggestions on how to solve this string validation problem or if it even makes sense? For sure, I can do it with !ensure macros.

1
  • 1
    This sounds like a reasonble idea, and should be doable in a backwards compatible way. Open an issue on Substrate, and if you are up for it, perhaps you can also implement it!
    – Shawn Tabrizi
    Aug 14, 2022 at 18:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.