-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add MaxEncodeLen
to implement_per_thing!
#10715
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
frame/support/test/tests/pallet.rs
Outdated
@@ -535,6 +535,27 @@ pub mod pallet4 { | |||
impl<T: Config> Pallet<T> {} | |||
} | |||
|
|||
/// Test that `Percent`, `PerU16`, `Permill`, `Perbill` and `Perquintill` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly think this is very out of context here.
Like, why should frame-support test that an external library type implements some trait? Should we add tests here to make sure all sp-blah-blah
types implement our desired traits, from the PoV of frame? clearly no.
I totally agree though that we should test for this, but this test should live in sp-arithmetic
, not here. There are similar tests there and that ensure all P: PerThing
s implement Compact
for example. This is exactly an identical scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointer to Compact
! The test just became trivial 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strongly feel that the test should be in sp-arithmetic, otherwise all good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying to prevent merge until #10715 (comment) is resolved.
This reverts commit 52558af.
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
This reverts commit 27a96f6.
bot merge |
* fix doc Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add MaxEncodedLen to implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test that Percent et.al. can be used in Storage. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Test that Percent et.al. can be used in Storage." This reverts commit 52558af. * Test MaxEncodedLen in implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Add comment" This reverts commit 27a96f6.
* fix doc Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add MaxEncodedLen to implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test that Percent et.al. can be used in Storage. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Test that Percent et.al. can be used in Storage." This reverts commit 52558af. * Test MaxEncodedLen in implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Add comment" This reverts commit 27a96f6.
* fix doc Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add MaxEncodedLen to implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test that Percent et.al. can be used in Storage. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Test that Percent et.al. can be used in Storage." This reverts commit 52558af. * Test MaxEncodedLen in implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Add comment" This reverts commit 27a96f6.
* fix doc Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add MaxEncodedLen to implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test that Percent et.al. can be used in Storage. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add comment Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Test that Percent et.al. can be used in Storage." This reverts commit 52558af. * Test MaxEncodedLen in implement_per_thing! Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Add comment" This reverts commit 27a96f6.
MaxEncodeLen
toimplement_per_thing!
Closes #10712