You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using BoundedVec, it's not possible to pass the data to this encoder or decoder, because the storage vector is padded and we don't have a way to specify the that only the first len bytes should be encoded/decoded. We need function variants that either accept types of BoundedVec instead of fixed-length arrays or that accept both an array and a specification of the length of the meaningful data inside that array.
Not that I can think of. We would need to be able to create a fixed-length array of the correct length from a BoundedVec, which isn't possible because we can't declare a fixed-length array to have a length that's not known at compile time
Workaround Description
No response
Additional Context
No response
Project Impact
Nice-to-have
Blocker Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered:
grjte
changed the title
make the lib more ergonomic for variable-length input data (e.g. BoundedVec)
enable encoding/decoding of variable-length input data (e.g. BoundedVec)
Nov 7, 2024
Problem
When using
BoundedVec
, it's not possible to pass the data to this encoder or decoder, because the storage vector is padded and we don't have a way to specify the that only the firstlen
bytes should be encoded/decoded. We need function variants that either accept types ofBoundedVec
instead of fixed-length arrays or that accept both an array and a specification of the length of the meaningful data inside that array.Happy Case
Example:
Workaround
Not that I can think of. We would need to be able to create a fixed-length array of the correct length from a BoundedVec, which isn't possible because we can't declare a fixed-length array to have a length that's not known at compile time
Workaround Description
No response
Additional Context
No response
Project Impact
Nice-to-have
Blocker Context
No response
Would you like to submit a PR for this Issue?
Yes
Support Needs
No response
The text was updated successfully, but these errors were encountered: