1
1
#![ allow( clippy:: unused_unit) ]
2
2
#![ cfg_attr( not( feature = "std" ) , no_std) ]
3
3
4
- pub mod migrations;
5
4
mod mock;
6
5
mod tests;
7
6
8
- use codec:: { FullCodec , HasCompact , MaxEncodedLen } ;
9
- use frame_support:: { pallet_prelude:: * , weights:: Weight } ;
10
- pub use migrations:: PoolInfoV0 ;
7
+ use codec:: { FullCodec , HasCompact } ;
8
+ use frame_support:: pallet_prelude:: * ;
11
9
use orml_traits:: RewardHandler ;
12
10
use sp_core:: U256 ;
13
11
use sp_runtime:: {
14
- traits:: { AtLeast32BitUnsigned , Convert , MaybeSerializeDeserialize , Member , Saturating , UniqueSaturatedInto , Zero } ,
12
+ traits:: { AtLeast32BitUnsigned , MaybeSerializeDeserialize , Member , Saturating , UniqueSaturatedInto , Zero } ,
15
13
FixedPointOperand , RuntimeDebug , SaturatedConversion ,
16
14
} ;
17
15
use sp_std:: { borrow:: ToOwned , collections:: btree_map:: BTreeMap , fmt:: Debug , prelude:: * } ;
@@ -67,14 +65,6 @@ pub mod module {
67
65
+ Debug
68
66
+ FixedPointOperand ;
69
67
70
- /// The old version of reward pool ID type.
71
- /// NOTE: remove it after migration
72
- type PoolIdV0 : Parameter + Member + Clone + FullCodec ;
73
-
74
- /// The convertor to convert PoolIdV0 to PoolId
75
- /// NOTE: remove it after migration
76
- type PoolIdConvertor : Convert < Self :: PoolIdV0 , Option < Self :: PoolId > > ;
77
-
78
68
/// The reward pool ID type.
79
69
type PoolId : Parameter + Member + Clone + FullCodec ;
80
70
@@ -90,26 +80,14 @@ pub mod module {
90
80
PoolDoesNotExist ,
91
81
}
92
82
93
- /// Stores reward pool info.
94
- /// NOTE: remove it after migration
95
- #[ pallet:: storage]
96
- #[ pallet:: getter( fn pools) ]
97
- pub type Pools < T : Config > = StorageMap < _ , Twox64Concat , T :: PoolIdV0 , PoolInfoV0 < T :: Share , T :: Balance > , ValueQuery > ;
98
-
99
83
/// Record reward pool info.
84
+ ///
85
+ /// map PoolId => PoolInfo
100
86
#[ pallet:: storage]
101
87
#[ pallet:: getter( fn pool_infos) ]
102
88
pub type PoolInfos < T : Config > =
103
89
StorageMap < _ , Twox64Concat , T :: PoolId , PoolInfo < T :: Share , T :: Balance , T :: CurrencyId > , ValueQuery > ;
104
90
105
- /// Record share amount and withdrawn reward amount for specific `AccountId`
106
- /// under `PoolId`.
107
- /// NOTE: remove it after migration
108
- #[ pallet:: storage]
109
- #[ pallet:: getter( fn share_and_withdrawn_reward) ]
110
- pub type ShareAndWithdrawnReward < T : Config > =
111
- StorageDoubleMap < _ , Twox64Concat , T :: PoolIdV0 , Twox64Concat , T :: AccountId , ( T :: Share , T :: Balance ) , ValueQuery > ;
112
-
113
91
/// Record share amount, reward currency and withdrawn reward amount for
114
92
/// specific `AccountId` under `PoolId`.
115
93
///
0 commit comments