Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

impl StorageDecodeLength for BTreeSet #12443

Closed
2 tasks done
kylezs opened this issue Oct 7, 2022 · 7 comments · Fixed by #12503
Closed
2 tasks done

impl StorageDecodeLength for BTreeSet #12443

kylezs opened this issue Oct 7, 2022 · 7 comments · Fixed by #12503
Assignees
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@kylezs
Copy link

kylezs commented Oct 7, 2022

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Would be nice if it were possible to call decode_len on an unbounded BTreeSet. Is there a limitation that makes this impossible atm?

Steps to reproduce

No response

@ggwpez
Copy link
Member

ggwpez commented Oct 10, 2022

Where do you want to use this? BTreeSet is not a storage item where we would normally need decode_len.

@bkchr
Copy link
Member

bkchr commented Oct 10, 2022

Why @ggwpez?

@kianenigma
Copy link
Contributor

sounds reasonable to have IMO.

@bkchr
Copy link
Member

bkchr commented Oct 11, 2022

Yeah.

@ggwpez
Copy link
Member

ggwpez commented Oct 11, 2022

Ah, I see we have impl<T: Encode> StorageDecodeLength for Vec<T> {}, so it could be done analogous for BTreeSet.

What I meant was that there is no StorageBTreeSet type, only BoundedBTreeSet. So if you want to decode the length of a StorageValue<BTreeSet>, you already have the whole thing fetched and have no PoV gain from using decode_len.

@kianenigma kianenigma added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder and removed J2-unconfirmed Issue might be valid, but it’s not yet known. labels Oct 14, 2022
@dharjeezy
Copy link
Contributor

Can I pick this up? @kianenigma @ggwpez

@ggwpez
Copy link
Member

ggwpez commented Oct 15, 2022

IMO yes @dharjeezy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants