Skip to content
Snippets Groups Projects
Unverified Commit 2f9e8c82 authored by bgallois's avatar bgallois
Browse files

upgrade pallets

parent 1849c018
Branches
No related tags found
1 merge request!324Upgrade polkadot v1.18.0
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
//! Various basic types for use in the identity pallet. //! Various basic types for use in the identity pallet.
use codec::{Decode, Encode}; use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::pallet_prelude::*; use frame_support::pallet_prelude::*;
use scale_info::{prelude::vec::Vec, TypeInfo}; use scale_info::{prelude::vec::Vec, TypeInfo};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
...@@ -45,7 +45,7 @@ pub enum IdtyEvent<T: crate::Config> { ...@@ -45,7 +45,7 @@ pub enum IdtyEvent<T: crate::Config> {
} }
/// Reasons for revocation. /// Reasons for revocation.
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] #[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)]
pub enum RevocationReason { pub enum RevocationReason {
/// Revoked by root (e.g., governance or migration). /// Revoked by root (e.g., governance or migration).
Root, Root,
...@@ -56,7 +56,7 @@ pub enum RevocationReason { ...@@ -56,7 +56,7 @@ pub enum RevocationReason {
} }
/// Reasons for removal. /// Reasons for removal.
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] #[derive(Encode, Decode, Clone, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)]
pub enum RemovalReason { pub enum RemovalReason {
/// Removed by root. /// Removed by root.
Root, Root,
...@@ -72,6 +72,7 @@ pub enum RemovalReason { ...@@ -72,6 +72,7 @@ pub enum RemovalReason {
#[derive( #[derive(
Encode, Encode,
Decode, Decode,
DecodeWithMemTracking,
Default, Default,
Clone, Clone,
PartialEq, PartialEq,
......
...@@ -57,7 +57,7 @@ impl<IdtyId, AccountId> SetupBenchmark<IdtyId, AccountId> for () { ...@@ -57,7 +57,7 @@ impl<IdtyId, AccountId> SetupBenchmark<IdtyId, AccountId> for () {
} }
/// Represent reasons for the removal of membership. /// Represent reasons for the removal of membership.
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] #[derive(Encode, Decode, Clone, DecodeWithMemTracking, PartialEq, Eq, RuntimeDebug, TypeInfo)]
pub enum MembershipRemovalReason { pub enum MembershipRemovalReason {
/// Indicates membership was removed because it reached the end of its life. /// Indicates membership was removed because it reached the end of its life.
Expired, Expired,
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
use crate::Config; use crate::Config;
use codec::{Decode, Encode}; use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::{dispatch::DispatchInfo, pallet_prelude::Weight, traits::IsSubType}; use frame_support::{dispatch::DispatchInfo, pallet_prelude::Weight, traits::IsSubType};
//use frame_system::Config; //use frame_system::Config;
use scale_info::{ use scale_info::{
...@@ -33,7 +33,7 @@ use sp_runtime::{ ...@@ -33,7 +33,7 @@ use sp_runtime::{
}; };
/// Wrapper around `frame_system::CheckNonce<T>`. /// Wrapper around `frame_system::CheckNonce<T>`.
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] #[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)]
#[scale_info(skip_type_params(Runtime))] #[scale_info(skip_type_params(Runtime))]
pub struct CheckNonce<T: Config>(pub frame_system::CheckNonce<T>); pub struct CheckNonce<T: Config>(pub frame_system::CheckNonce<T>);
...@@ -74,7 +74,7 @@ where ...@@ -74,7 +74,7 @@ where
info: &DispatchInfoOf<T::RuntimeCall>, info: &DispatchInfoOf<T::RuntimeCall>,
len: usize, len: usize,
self_implicit: Self::Implicit, self_implicit: Self::Implicit,
inherited_implication: &impl Encode, inherited_implication: &(impl Encode + sp_runtime::traits::Implication),
source: TransactionSource, source: TransactionSource,
) -> ValidateResult<Self::Val, T::RuntimeCall> { ) -> ValidateResult<Self::Val, T::RuntimeCall> {
self.0.validate( self.0.validate(
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use codec::{Decode, Encode}; use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::pallet_prelude::*; use frame_support::pallet_prelude::*;
/// The type of account. /// The type of account.
#[derive(Clone, Decode, Encode, PartialEq, RuntimeDebug, TypeInfo)] #[derive(Clone, Decode, Encode, DecodeWithMemTracking, PartialEq, RuntimeDebug, TypeInfo)]
pub enum Account<AccountId> { pub enum Account<AccountId> {
/// Normal account type. /// Normal account type.
Normal(AccountId), Normal(AccountId),
......
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
//! Various basic types for use in pallet provide randomness //! Various basic types for use in pallet provide randomness
use super::RequestId; use super::RequestId;
use codec::{Decode, Encode}; use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::pallet_prelude::*; use frame_support::pallet_prelude::*;
use scale_info::TypeInfo; use scale_info::TypeInfo;
use sp_core::H256; use sp_core::H256;
/// The type of randomness source. /// The type of randomness source.
#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] #[derive(
Clone, DecodeWithMemTracking, Copy, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo,
)]
pub enum RandomnessType { pub enum RandomnessType {
/// Randomness derived from the previous block. /// Randomness derived from the previous block.
RandomnessFromPreviousBlock, RandomnessFromPreviousBlock,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use codec::{Decode, Encode, Error, Input, MaxEncodedLen, Output}; use codec::{Decode, DecodeWithMemTracking, Encode, Error, Input, MaxEncodedLen, Output};
use core::num::NonZeroU16; use core::num::NonZeroU16;
use scale_info::prelude::vec::Vec; use scale_info::prelude::vec::Vec;
use sp_runtime::RuntimeDebug; use sp_runtime::RuntimeDebug;
...@@ -22,7 +22,9 @@ use sp_runtime::RuntimeDebug; ...@@ -22,7 +22,9 @@ use sp_runtime::RuntimeDebug;
pub type UdIndex = u16; pub type UdIndex = u16;
/// Represents the first eligible Universal Dividend. /// Represents the first eligible Universal Dividend.
#[derive(Clone, Eq, PartialEq, RuntimeDebug, serde::Deserialize, serde::Serialize)] #[derive(
Clone, Eq, DecodeWithMemTracking, PartialEq, RuntimeDebug, serde::Deserialize, serde::Serialize,
)]
pub struct FirstEligibleUd(pub Option<NonZeroU16>); pub struct FirstEligibleUd(pub Option<NonZeroU16>);
/// Default is not eligible /// Default is not eligible
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::type_complexity)] #![allow(clippy::type_complexity)]
use codec::{Decode, Encode}; use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::pallet_prelude::RuntimeDebug; use frame_support::pallet_prelude::RuntimeDebug;
use scale_info::TypeInfo; use scale_info::TypeInfo;
use sp_inherents::{InherentData, InherentIdentifier, IsFatalError}; use sp_inherents::{InherentData, InherentIdentifier, IsFatalError};
...@@ -30,7 +30,7 @@ use std::marker::PhantomData; ...@@ -30,7 +30,7 @@ use std::marker::PhantomData;
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"distanc0"; pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"distanc0";
/// Represents the result of a distance computation. /// Represents the result of a distance computation.
#[derive(Clone, Decode, Encode, PartialEq, RuntimeDebug, TypeInfo)] #[derive(Clone, DecodeWithMemTracking, Decode, Encode, PartialEq, RuntimeDebug, TypeInfo)]
pub struct ComputationResult { pub struct ComputationResult {
pub distances: scale_info::prelude::vec::Vec<Perbill>, pub distances: scale_info::prelude::vec::Vec<Perbill>,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment