git.delta.rocks / unique-network / refs/commits / 59616c1c2c6f

difftreelog

chore fixed code review requests

Grigoriy Simonov2022-07-18parent: #4b7d828.patch.diff
in: master

1 file changed

modifiedpallets/structure/src/lib.rsdiffbeforeafterboth
42//!42//!
43//! ## Interface43//! ## Interface
44//!44//!
45//! ### Dispatchable Functions45//! ### Available Functions
46//!46//!
47//! - `find_parent` - Find parent of the token. It could be an account or another token.47//! - `find_parent` - Find parent of the token. It could be an account or another token.
48//! - `parent_chain` - Find chain of parents of the token.48//! - `parent_chain` - Find chain of parents of the token.
49//! - `find_topmost_owner` - Find account or token in the end of the chain of parents.49//! - `find_topmost_owner` - Find account or token in the end of the chain of parents.
50//! - `check_nesting` - Check if the token could be nested in the other token50//! - `check_nesting` - Check if the token could be nested in the other token
51//! - `nest_if_sent_to_token` - Nest the token in the other token51//! - `nest_if_sent_to_token` - Nest the token in the other token
52//! - `unnest_if_nested` - Unnest the token from the other token52//! - `unnest_if_nested` - Unnest the token from the other token
53//!
54//! ## Assumptions
55//!
56//! * Total issued balanced of all accounts should be less than `Config::Balance::max_value()`.
5753
58#![cfg_attr(not(feature = "std"), no_std)]54#![cfg_attr(not(feature = "std"), no_std)]
5955
218 })214 })
219 }215 }
220216
221 /// Find the topmost parent and check that assigning `for_nest` token as a parent for217 /// Find the topmost parent and check that assigning `for_nest` token as a child for
222 /// any token in the parents chain wouldn't create a cycle.218 /// `token` wouldn't create a cycle.
223 ///219 ///
224 /// - `budget`: Limit for searching parents in depth.220 /// - `budget`: Limit for searching parents in depth.
225 pub fn get_checked_topmost_owner(221 pub fn get_checked_topmost_owner(
271 ///267 ///
272 /// Returns `true` if `user` is `token`'s owner. Or If token is provided as `user` then268 /// Returns `true` if `user` is `token`'s owner. Or If token is provided as `user` then
273 /// check that `user` and `token` have same owner.269 /// check that `user` and `token` have same owner.
274 /// Checks that assigning `for_nest` token as a parent for any token in the `token`'s270 /// Checks that assigning `for_nest` token as a child for `token` wouldn't create a cycle.
275 /// parents chain wouldn't create a cycle.
276 ///271 ///
277 /// - `budget`: Limit for searching parents in depth.272 /// - `budget`: Limit for searching parents in depth.
278 pub fn check_indirectly_owned(273 pub fn check_indirectly_owned(