Skip to content

Commit a814f55

Browse files
[AHM] Make more stuff public (#7802)
Make some more stuff public that will be useful for AHM to reduce code duplication. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 9a8061e commit a814f55

3 files changed

Lines changed: 33 additions & 21 deletions

File tree

prdoc/pr_7802.prdoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
title: '[AHM] child bounties and recovery: make more stuff public'
2+
doc:
3+
- audience: Runtime Dev
4+
description: |
5+
Make some items in the child-bounties and recovery pallet public to reduce code-duplication for
6+
the Asset Hub migration.
7+
crates:
8+
- name: pallet-child-bounties
9+
bump: minor
10+
- name: pallet-recovery
11+
bump: minor

substrate/frame/child-bounties/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,26 @@ pub use weights::WeightInfo;
8888

8989
pub use pallet::*;
9090

91-
type BalanceOf<T> = pallet_treasury::BalanceOf<T>;
92-
type BountiesError<T> = pallet_bounties::Error<T>;
93-
type BountyIndex = pallet_bounties::BountyIndex;
94-
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
95-
type BlockNumberFor<T> =
91+
pub type BalanceOf<T> = pallet_treasury::BalanceOf<T>;
92+
pub type BountiesError<T> = pallet_bounties::Error<T>;
93+
pub type BountyIndex = pallet_bounties::BountyIndex;
94+
pub type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
95+
pub type BlockNumberFor<T> =
9696
<<T as pallet_treasury::Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber;
9797

9898
/// A child bounty proposal.
9999
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
100100
pub struct ChildBounty<AccountId, Balance, BlockNumber> {
101101
/// The parent of this child-bounty.
102-
parent_bounty: BountyIndex,
102+
pub parent_bounty: BountyIndex,
103103
/// The (total) amount that should be paid if this child-bounty is rewarded.
104-
value: Balance,
104+
pub value: Balance,
105105
/// The child bounty curator fee.
106-
fee: Balance,
106+
pub fee: Balance,
107107
/// The deposit of child-bounty curator.
108-
curator_deposit: Balance,
108+
pub curator_deposit: Balance,
109109
/// The status of this child-bounty.
110-
status: ChildBountyStatus<AccountId, BlockNumber>,
110+
pub status: ChildBountyStatus<AccountId, BlockNumber>,
111111
}
112112

113113
/// The status of a child-bounty.

substrate/frame/recovery/src/lib.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,38 +181,39 @@ mod mock;
181181
mod tests;
182182
pub mod weights;
183183

184-
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
185-
type BalanceOf<T> =
184+
pub type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
185+
pub type BalanceOf<T> =
186186
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
187-
type BlockNumberFromProviderOf<T> =
187+
pub type BlockNumberFromProviderOf<T> =
188188
<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber;
189-
type FriendsOf<T> = BoundedVec<<T as frame_system::Config>::AccountId, <T as Config>::MaxFriends>;
189+
pub type FriendsOf<T> =
190+
BoundedVec<<T as frame_system::Config>::AccountId, <T as Config>::MaxFriends>;
190191

191192
/// An active recovery process.
192193
#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, RuntimeDebug, TypeInfo, MaxEncodedLen)]
193194
pub struct ActiveRecovery<BlockNumber, Balance, Friends> {
194195
/// The block number when the recovery process started.
195-
created: BlockNumber,
196+
pub created: BlockNumber,
196197
/// The amount held in reserve of the `depositor`,
197198
/// to be returned once this recovery process is closed.
198-
deposit: Balance,
199+
pub deposit: Balance,
199200
/// The friends which have vouched so far. Always sorted.
200-
friends: Friends,
201+
pub friends: Friends,
201202
}
202203

203204
/// Configuration for recovering an account.
204205
#[derive(Clone, Eq, PartialEq, Encode, Decode, Default, RuntimeDebug, TypeInfo, MaxEncodedLen)]
205206
pub struct RecoveryConfig<BlockNumber, Balance, Friends> {
206207
/// The minimum number of blocks since the start of the recovery process before the account
207208
/// can be recovered.
208-
delay_period: BlockNumber,
209+
pub delay_period: BlockNumber,
209210
/// The amount held in reserve of the `depositor`,
210211
/// to be returned once this configuration is removed.
211-
deposit: Balance,
212+
pub deposit: Balance,
212213
/// The list of friends which can help recover an account. Always sorted.
213-
friends: Friends,
214+
pub friends: Friends,
214215
/// The number of approving friends needed to recover an account.
215-
threshold: u16,
216+
pub threshold: u16,
216217
}
217218

218219
#[frame_support::pallet]

0 commit comments

Comments
 (0)