Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pool accounts view_function #6408

Draft
wants to merge 3 commits into
base: aj/view-functions
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions substrate/frame/nomination-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,16 @@ pub mod pallet {
pub type ClaimPermissions<T: Config> =
StorageMap<_, Twox64Concat, T::AccountId, ClaimPermission, ValueQuery>;

#[pallet::view_functions]
impl<T: Config> Pallet<T> {
/// Provide bonded account and reward account for nomination pool.
pub fn pool_accountss(pool_id: PoolId) -> (T::AccountId, T::AccountId) {
let bonded_account = Self::generate_bonded_account(pool_id);
let reward_account = Self::generate_reward_account(pool_id);
(bonded_account, reward_account)
}
}

#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub min_join_bond: BalanceOf<T>,
Expand Down
Loading