Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derived MaxEncodedLen #1043

Merged
merged 1 commit into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/dex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#![allow(clippy::unused_unit)]
#![allow(clippy::collapsible_if)]

use frame_support::{log, pallet_prelude::*, transactional, PalletId};
use frame_support::{log, pallet_prelude::*, traits::MaxEncodedLen, transactional, PalletId};
use frame_system::pallet_prelude::*;
use orml_traits::{MultiCurrency, MultiCurrencyExtended};
use primitives::{Balance, CurrencyId, TradingPair};
Expand All @@ -53,7 +53,7 @@ pub use module::*;
pub use weights::WeightInfo;

/// Parameters of TradingPair in Provisioning status
#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, PartialEq, Eq)]
#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, PartialEq, Eq, MaxEncodedLen)]
pub struct TradingPairProvisionParameters<Balance, BlockNumber> {
/// limit contribution per time.
min_contribution: (Balance, Balance),
Expand All @@ -66,7 +66,7 @@ pub struct TradingPairProvisionParameters<Balance, BlockNumber> {
}

/// Status for TradingPair
#[derive(Clone, Copy, Encode, Decode, RuntimeDebug, PartialEq, Eq)]
#[derive(Clone, Copy, Encode, Decode, RuntimeDebug, PartialEq, Eq, MaxEncodedLen)]
pub enum TradingPairStatus<Balance, BlockNumber> {
/// Default status,
/// can withdraw liquidity, re-enable and list this trading pair.
Expand Down
8 changes: 4 additions & 4 deletions modules/homa-validator-list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#![allow(clippy::unused_unit)]
#![allow(clippy::collapsible_if)]

use frame_support::{pallet_prelude::*, transactional};
use frame_support::{pallet_prelude::*, traits::MaxEncodedLen, transactional};
use frame_system::pallet_prelude::*;
use orml_traits::{BasicCurrency, BasicLockableCurrency, Contains, Happened, LockIdentifier};
use primitives::Balance;
Expand Down Expand Up @@ -83,7 +83,7 @@ impl WeightInfo for () {
}
}

#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, Default, PartialEq)]
#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, Default, PartialEq, MaxEncodedLen)]
pub struct Guarantee<BlockNumber> {
total: Balance,
bonded: Balance,
Expand Down Expand Up @@ -136,14 +136,14 @@ impl<BlockNumber: PartialOrd> Guarantee<BlockNumber> {
}
}

#[derive(Encode, Decode, Clone, RuntimeDebug, Eq, PartialEq)]
#[derive(Encode, Decode, Clone, RuntimeDebug, Eq, PartialEq, MaxEncodedLen)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct SlashInfo<Balance, RelaychainAccountId> {
validator: RelaychainAccountId,
relaychain_token_amount: Balance,
}

#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, Default)]
#[derive(Encode, Decode, Clone, Copy, RuntimeDebug, Default, MaxEncodedLen)]
pub struct ValidatorBacking {
total_insurance: Balance,
is_frozen: bool,
Expand Down
4 changes: 2 additions & 2 deletions modules/homa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::unused_unit)]

use frame_support::{pallet_prelude::*, transactional};
use frame_support::{pallet_prelude::*, traits::MaxEncodedLen, transactional};
use frame_system::pallet_prelude::*;
use primitives::{Balance, EraIndex};
use sp_runtime::RuntimeDebug;
Expand All @@ -47,7 +47,7 @@ pub use weights::WeightInfo;
/// get back the DOT. 3. WaitForUnbonding: User request unbond, the staking
/// pool will process unbonding in the next era, and user needs to wait for
/// the complete unbonding era which determined by Polkadot.
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, MaxEncodedLen)]
pub enum RedeemStrategy {
Immediately,
Target(EraIndex),
Expand Down
4 changes: 2 additions & 2 deletions modules/loans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#![allow(clippy::unused_unit)]
#![allow(clippy::collapsible_if)]

use frame_support::{log, pallet_prelude::*, transactional, PalletId};
use frame_support::{log, pallet_prelude::*, traits::MaxEncodedLen, transactional, PalletId};
use orml_traits::{Happened, MultiCurrency, MultiCurrencyExtended};
use primitives::{Amount, Balance, CurrencyId};
use sp_runtime::{
Expand All @@ -43,7 +43,7 @@ mod tests;
pub use module::*;

/// A collateralized debit position.
#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, Default)]
#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, Default, MaxEncodedLen)]
pub struct Position {
/// The amount of collateral.
pub collateral: Balance,
Expand Down