Skip to content

Commit

Permalink
add default MaxEncodedLen
Browse files Browse the repository at this point in the history
  • Loading branch information
re-gius committed Oct 31, 2024
1 parent dd9924f commit c349d06
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions polkadot/runtime/common/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#[cfg(not(feature = "std"))]
use alloc::{format, string::String};
use alloc::{vec, vec::Vec};
use codec::{Decode, Encode};
use codec::{Decode, Encode, MaxEncodedLen};
use core::fmt::Debug;
use frame_support::{
ensure,
Expand Down Expand Up @@ -82,7 +82,17 @@ impl WeightInfo for TestWeightInfo {

/// The kind of statement an account needs to make for a claim to be valid.
#[derive(
Encode, Decode, Clone, Copy, Eq, PartialEq, RuntimeDebug, TypeInfo, Serialize, Deserialize,
Encode,
Decode,
Clone,
Copy,
Eq,
PartialEq,
RuntimeDebug,
TypeInfo,
Serialize,
Deserialize,
MaxEncodedLen,
)]
pub enum StatementKind {
/// Statement required to be made by non-SAFT holders.
Expand Down Expand Up @@ -116,7 +126,9 @@ impl Default for StatementKind {
/// An Ethereum address (i.e. 20 bytes, used to represent an Ethereum account).
///
/// This gets serialized to the 0x-prefixed hex representation.
#[derive(Clone, Copy, PartialEq, Eq, Encode, Decode, Default, RuntimeDebug, TypeInfo)]
#[derive(
Clone, Copy, PartialEq, Eq, Encode, Decode, Default, RuntimeDebug, TypeInfo, MaxEncodedLen,
)]
pub struct EthereumAddress([u8; 20]);

impl Serialize for EthereumAddress {
Expand Down Expand Up @@ -150,7 +162,7 @@ impl<'de> Deserialize<'de> for EthereumAddress {
}
}

#[derive(Encode, Decode, Clone, TypeInfo)]
#[derive(Encode, Decode, Clone, TypeInfo, MaxEncodedLen)]
pub struct EcdsaSignature(pub [u8; 65]);

impl PartialEq for EcdsaSignature {
Expand All @@ -172,7 +184,6 @@ pub mod pallet {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);

/// Configuration trait.
Expand Down

0 comments on commit c349d06

Please sign in to comment.