Skip to content
Snippets Groups Projects
Unverified Commit 38d2fa85 authored by José Molina Colmenero's avatar José Molina Colmenero Committed by GitHub
Browse files

Add an extra_constant to pallet-treasury (#7918)


Aligned with #7206, this PR exposes `pallet-treasury`'s pot account as
an extra constant. Users can this way for instance donate to the chain's
treasury account, or founders can easily spot it in case they require to
fund it.

In any case this greatly reduces errors and headaches trying to figure
out what's the pot's address.

---------

Co-authored-by: default avatarBastian Köcher <git@kchr.de>
Co-authored-by: default avatarGuillaume Thiolliere <gui.thiolliere@gmail.com>
parent 88a31f2d
No related merge requests found
Pipeline #519216 waiting for manual action with stages
in 1 hour, 13 minutes, and 42 seconds
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
title: "Add an extra_constant to pallet-treasury"
doc:
- audience: Runtime Dev
description: |
- Allows to query pallet-treasury's pot account via extra constant.
crates:
- name: pallet-treasury
bump: minor
......@@ -289,6 +289,14 @@ pub mod pallet {
type BlockNumberProvider: BlockNumberProvider;
}
#[pallet::extra_constants]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Gets this pallet's derived pot account.
fn pot_account() -> T::AccountId {
Self::account_id()
}
}
/// DEPRECATED: associated with `spend_local` call and will be removed in May 2025.
/// Refer to <https://github.com/paritytech/polkadot-sdk/pull/5961> for migration to `spend`.
///
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment