I saw that some of the calls in frame take Vec as a parameter. I haven't found a call that takes BoundedVec, but my impression was that I should basically always use BoundedVec over Vec?

  • This depends very much on the context it is used. Perhaps provide a few examples to reference?
    – Nuke
    Apr 9, 2022 at 3:22
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Apr 9, 2022 at 3:22

1 Answer 1

  1. BoundedVec is still a relatively new type that was introduced in the last months. It is not yet used everywhere.
  2. BoundedVec is mainly useful for when you want to make your storage bound to some maximum number of elements. A call should already by bound by a proper fee model. Meaning if someone wants to send you 1MB of data in one call, they need to pay for it. BoundedVec doesn't make that much sense there. However, if you want to have a static upper bound, then you can for sure also use BoundedVec as a parameter.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.