Skip to content

Add ConstEncodedLen#428

Merged
ggwpez merged 9 commits intomasterfrom
oty-const-encoded-len
May 4, 2023
Merged

Add ConstEncodedLen#428
ggwpez merged 9 commits intomasterfrom
oty-const-encoded-len

Conversation

@ggwpez
Copy link
Member

@ggwpez ggwpez commented Apr 29, 2023

Closes #427
Adds a ConstEncodedLen trait that marks types that can be used for in-place memory operations.

I put it under the max-encoded-len feature. Another feature seems overkill, since it already relies on MEL.
Derive macro makes no sense here, or? I did not add one.

As context: in the MQ we are abusing the MEL bound as CEL in multiple spots under the assumption that they are equal, eg here. This is bound to break if someone configures compact integers in the pallet config.

TODO:

  • Formatting / CI
  • Changelog
  • Minor version bump

ggwpez added 2 commits April 29, 2023 15:51
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Seems all to come from the 'proptest'. But the the 'quickcheck'
is unmaintained, so rather not using it.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Copy link
Contributor

@mrcnski mrcnski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get some compile errors when I run cargo test --features "max-encoded-len". Looks like CI doesn't catch this.

Apart from that looks good to me!

Co-authored-by: Bastian Köcher <git@kchr.de>
@ggwpez ggwpez mentioned this pull request May 3, 2023
ggwpez added 5 commits May 3, 2023 22:44
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Just to ensure that there is no accidential update of the lock.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez requested a review from mrcnski May 4, 2023 08:16
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez merged commit 4502678 into master May 4, 2023
@ggwpez ggwpez deleted the oty-const-encoded-len branch October 27, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marker trait ConstEncodedLen

3 participants