Skip to content

Commit 463635e

Browse files
authored
Remove without_storage_info for oracle (#772)
* MEL for oracle * fmt
1 parent d52e7f2 commit 463635e

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

oracle/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ pub mod module {
8383
type OracleValue: Parameter + Member + Ord + MaxEncodedLen;
8484

8585
/// The root operator account id, record all sudo feeds on this account.
86+
#[pallet::constant]
8687
type RootOperatorAccountId: Get<Self::AccountId>;
8788

8889
/// Oracle operators.
@@ -92,6 +93,7 @@ pub mod module {
9293
type WeightInfo: WeightInfo;
9394

9495
/// Maximum size of HasDispatched
96+
#[pallet::constant]
9597
type MaxHasDispatchedSize: Get<u32>;
9698
}
9799

@@ -132,7 +134,6 @@ pub mod module {
132134

133135
#[pallet::pallet]
134136
#[pallet::generate_store(pub(super) trait Store)]
135-
#[pallet::without_storage_info]
136137
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
137138

138139
#[pallet::hooks]

utilities/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ edition = "2021"
99

1010
[dependencies]
1111
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }
12-
serde = { version = "1.0.136", optional = true }
13-
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
12+
serde = { version = "1.0.136", optional = true, features = ["derive"] }
13+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
1414

1515
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.24" }
1616
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.24" }

utilities/src/ordered_set.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
use codec::{Decode, Encode, MaxEncodedLen};
2-
use frame_support::{traits::Get, BoundedVec, DefaultNoBound};
2+
use frame_support::{traits::Get, BoundedVec, CloneNoBound, DefaultNoBound, PartialEqNoBound};
33
use scale_info::TypeInfo;
44
#[cfg(feature = "std")]
55
use sp_std::{fmt, prelude::*};
66

77
/// An ordered set backed by `BoundedVec`
8-
#[derive(PartialEq, Eq, Encode, Decode, DefaultNoBound, Clone, TypeInfo, MaxEncodedLen)]
8+
#[derive(PartialEqNoBound, Eq, Encode, Decode, DefaultNoBound, CloneNoBound, TypeInfo, MaxEncodedLen)]
9+
#[codec(mel_bound())]
910
#[scale_info(skip_type_params(S))]
10-
pub struct OrderedSet<T, S: Get<u32>>(pub BoundedVec<T, S>);
11+
pub struct OrderedSet<T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq, S: Get<u32>>(
12+
pub BoundedVec<T, S>,
13+
);
1114

12-
impl<T: Ord, S: Get<u32>> OrderedSet<T, S> {
15+
impl<T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq, S: Get<u32>> OrderedSet<T, S> {
1316
/// Create a new empty set
1417
pub fn new() -> Self {
1518
Self(BoundedVec::default())
@@ -63,7 +66,9 @@ impl<T: Ord, S: Get<u32>> OrderedSet<T, S> {
6366
}
6467
}
6568

66-
impl<T: Ord, S: Get<u32>> From<BoundedVec<T, S>> for OrderedSet<T, S> {
69+
impl<T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq, S: Get<u32>> From<BoundedVec<T, S>>
70+
for OrderedSet<T, S>
71+
{
6772
fn from(v: BoundedVec<T, S>) -> Self {
6873
Self::from(v)
6974
}
@@ -72,7 +77,7 @@ impl<T: Ord, S: Get<u32>> From<BoundedVec<T, S>> for OrderedSet<T, S> {
7277
#[cfg(feature = "std")]
7378
impl<T, S> fmt::Debug for OrderedSet<T, S>
7479
where
75-
T: fmt::Debug,
80+
T: Ord + Encode + Decode + MaxEncodedLen + Clone + Eq + PartialEq + fmt::Debug,
7681
S: Get<u32>,
7782
{
7883
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)