Skip to content

Commit 2721167

Browse files
authored
Merge branch 'master' into ankn/staking-classic
2 parents d9ccb91 + 38d2fa8 commit 2721167

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

prdoc/pr_7918.prdoc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
2+
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
3+
4+
title: "Add an extra_constant to pallet-treasury"
5+
6+
doc:
7+
- audience: Runtime Dev
8+
description: |
9+
- Allows to query pallet-treasury's pot account via extra constant.
10+
11+
crates:
12+
- name: pallet-treasury
13+
bump: minor

substrate/frame/treasury/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,14 @@ pub mod pallet {
289289
type BlockNumberProvider: BlockNumberProvider;
290290
}
291291

292+
#[pallet::extra_constants]
293+
impl<T: Config<I>, I: 'static> Pallet<T, I> {
294+
/// Gets this pallet's derived pot account.
295+
fn pot_account() -> T::AccountId {
296+
Self::account_id()
297+
}
298+
}
299+
292300
/// DEPRECATED: associated with `spend_local` call and will be removed in May 2025.
293301
/// Refer to <https://github.com/paritytech/polkadot-sdk/pull/5961> for migration to `spend`.
294302
///

0 commit comments

Comments
 (0)