difftreelog
fix typos , teminology
in: master
2 files changed
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -116,10 +116,10 @@
/// Type for interacting with conrtacts
type ContractHandler: ContractHandler<AccountId = Self::CrossAccountId, ContractId = H160>;
- /// ID for treasury
+ /// `AccountId` for treasury
type TreasuryAccountId: Get<Self::AccountId>;
- /// The app's pallet id, used for deriving its sovereign account ID.
+ /// The app's pallet id, used for deriving its sovereign account address.
#[pallet::constant]
type PalletId: Get<PalletId>;
@@ -159,7 +159,7 @@
/// Staking recalculation was performed
///
/// # Arguments
- /// * AccountId: ID of the staker.
+ /// * AccountId: account of the staker.
/// * Balance : recalculation base
/// * Balance : total income
StakingRecalculation(
@@ -174,21 +174,21 @@
/// Staking was performed
///
/// # Arguments
- /// * AccountId: ID of the staker
+ /// * AccountId: account of the staker
/// * Balance : staking amount
Stake(T::AccountId, BalanceOf<T>),
/// Unstaking was performed
///
/// # Arguments
- /// * AccountId: ID of the staker
+ /// * AccountId: account of the staker
/// * Balance : unstaking amount
Unstake(T::AccountId, BalanceOf<T>),
/// The admin was set
///
/// # Arguments
- /// * AccountId: ID of the admin
+ /// * AccountId: account address of the admin
SetAdmin(T::AccountId),
}
@@ -212,13 +212,13 @@
#[pallet::storage]
pub type TotalStaked<T: Config> = StorageValue<Value = BalanceOf<T>, QueryKind = ValueQuery>;
- /// Stores the `admin` ID. Some extrinsics can only be executed if they were signed by `admin`.
+ /// Stores the `admin` account. Some extrinsics can only be executed if they were signed by `admin`.
#[pallet::storage]
pub type Admin<T: Config> = StorageValue<Value = T::AccountId, QueryKind = OptionQuery>;
/// Stores the amount of tokens staked by account in the blocknumber.
///
- /// * **Key1** - Staker ID.
+ /// * **Key1** - Staker account.
/// * **Key2** - Relay block number when the stake was made.
/// * **(Balance, BlockNumber)** - Balance of the stake.
/// The number of the relay block in which we must perform the interest recalculation
@@ -234,7 +234,7 @@
/// Stores amount of stakes for an `Account`.
///
- /// * **Key** - Staker ID.
+ /// * **Key** - Staker account.
/// * **Value** - Amount of stakes.
#[pallet::storage]
pub type StakesPerAccount<T: Config> =
@@ -242,7 +242,7 @@
/// Stores amount of stakes for an `Account`.
///
- /// * **Key** - Staker ID.
+ /// * **Key** - Staker account.
/// * **Value** - Amount of stakes.
#[pallet::storage]
pub type PendingUnstake<T: Config> = StorageMap<
@@ -296,7 +296,7 @@
///
/// # Arguments
///
- /// * `admin`: ID of the new admin.
+ /// * `admin`: account of the new admin.
#[pallet::weight(T::WeightInfo::set_admin_address())]
pub fn set_admin_address(origin: OriginFor<T>, admin: T::CrossAccountId) -> DispatchResult {
ensure_root(origin)?;
@@ -332,7 +332,7 @@
let balance =
<<T as Config>::Currency as Currency<T::AccountId>>::free_balance(&staker_id);
- // cheks that we can lock `amount` on the `staker` account.
+ // checks that we can lock `amount` on the `staker` account.
<<T as Config>::Currency as Currency<T::AccountId>>::ensure_can_withdraw(
&staker_id,
amount,
@@ -498,7 +498,7 @@
///
/// # Arguments
///
- /// * `contract_id`: ID of the contract that will be sponsored by `pallet_id`
+ /// * `contract_id`: the contract address that will be sponsored by `pallet_id`
#[pallet::weight(T::WeightInfo::sponsor_contract())]
pub fn sponsor_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {
let admin_id = ensure_signed(admin)?;
@@ -524,7 +524,7 @@
///
/// # Arguments
///
- /// * `contract_id`: ID of the contract that is sponsored by `pallet_id`
+ /// * `contract_id`: the contract address that is sponsored by `pallet_id`
#[pallet::weight(T::WeightInfo::stop_sponsoring_contract())]
pub fn stop_sponsoring_contract(admin: OriginFor<T>, contract_id: H160) -> DispatchResult {
let admin_id = ensure_signed(admin)?;
@@ -584,7 +584,7 @@
let income_acc = RefCell::new(BalanceOf::<T>::default());
let amount_acc = RefCell::new(BalanceOf::<T>::default());
- // this closure is uded to perform some of the actions if we break the loop because we reached the number of stakers for recalculation,
+ // this closure is used to perform some of the actions if we break the loop because we reached the number of stakers for recalculation,
// but there were unrecalculated records in the storage.
let flush_stake = || -> DispatchResult {
if let Some(last_id) = &*last_id.borrow() {
@@ -654,7 +654,7 @@
}
impl<T: Config> Pallet<T> {
- /// The account ID of the app promotion pot.
+ /// The account address of the app promotion pot.
///
/// This actually does computation. If you need to keep using it, then make sure you cache the
/// value and only call this once.
@@ -664,7 +664,7 @@
/// Unlocks the balance that was locked by the pallet.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
/// - `amount`: amount of unlocked funds.
fn unlock_balance(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {
let locked_balance = Self::get_locked_balance(staker)
@@ -684,7 +684,7 @@
/// Adds the balance to locked by the pallet.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
/// - `amount`: amount of added locked funds.
fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf<T>) -> DispatchResult {
Self::get_locked_balance(staker)
@@ -696,7 +696,7 @@
/// Sets the new state of a balance locked by the pallet.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
/// - `amount`: amount of locked funds.
fn set_lock_unchecked(staker: &T::AccountId, amount: BalanceOf<T>) {
if amount.is_zero() {
@@ -713,7 +713,7 @@
/// Returns the balance locked by the pallet for the staker.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
pub fn get_locked_balance(
staker: impl EncodeLike<T::AccountId>,
) -> Option<BalanceLock<BalanceOf<T>>> {
@@ -724,7 +724,7 @@
/// Returns the total staked balance for the staker.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
pub fn total_staked_by_id(staker: impl EncodeLike<T::AccountId>) -> Option<BalanceOf<T>> {
let staked = Staked::<T>::iter_prefix((staker,))
.into_iter()
@@ -741,7 +741,7 @@
/// Returns all relay block numbers when stake was made,
/// the amount of the stake.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
pub fn total_staked_by_id_per_block(
staker: impl EncodeLike<T::AccountId>,
) -> Option<Vec<(T::BlockNumber, BalanceOf<T>)>> {
@@ -759,9 +759,8 @@
/// Returns the total staked balance for the staker.
/// If `staker` is `None`, returns the total amount staked.
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
///
- /// **Note**: This `fn` has been added to implement RPC
pub fn cross_id_total_staked(staker: Option<T::CrossAccountId>) -> Option<BalanceOf<T>> {
staker.map_or(Some(<TotalStaked<T>>::get()), |s| {
Self::total_staked_by_id(s.as_sub())
@@ -777,9 +776,8 @@
/// Returns all relay block numbers when stake was made,
/// the amount of the stake.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
///
- /// **Note**: This `fn` has been added to implement RPC
pub fn cross_id_total_staked_per_block(
staker: T::CrossAccountId,
) -> Vec<(T::BlockNumber, BalanceOf<T>)> {
@@ -829,7 +827,7 @@
/// Returns the amount reserved by the pending.
/// If `staker` is `None`, returns the total pending.
///
- /// -`staker`: staker ID.
+ /// -`staker`: staker account.
///
/// Since user funds are not transferred anywhere by staking, overflow protection is provided
/// at the level of the associated type `Balance` of `Currency` trait. In order to overflow,
@@ -859,7 +857,7 @@
/// Returns all parachain block numbers when unreserve is expected,
/// the amount of the unreserved funds.
///
- /// - `staker`: staker ID.
+ /// - `staker`: staker account.
///
/// **Note**: This `fn` has been added to implement RPC
pub fn cross_id_pending_unstake_per_block(
pallets/app-promotion/src/types.rsdiffbeforeafterboth12/// This trait was defined because `LockableCurrency`12/// This trait was defined because `LockableCurrency`13/// has no way to know the state of the lock for an account.13/// has no way to know the state of the lock for an account.14pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {14pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {15 /// Returns lock balance for ID. Allows to determine the cause of the lock.15 /// Returns lock balance for an account. Allows to determine the cause of the lock.16 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>16 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>17 where17 where18 KArg: EncodeLike<AccountId>;18 KArg: EncodeLike<AccountId>;353536 /// Sets sponsor for a collection.36 /// Sets sponsor for a collection.37 ///37 ///38 /// - `sponsor_id`: ID of the account of the sponsor-to-be.38 /// - `sponsor_id`: the account of the sponsor-to-be.39 /// - `collection_id`: ID of the modified collection.39 /// - `collection_id`: ID of the modified collection.40 fn set_sponsor(40 fn set_sponsor(41 sponsor_id: Self::AccountId,41 sponsor_id: Self::AccountId,868687 /// Sets sponsor for a contract.87 /// Sets sponsor for a contract.88 ///88 ///89 /// - `sponsor_id`: ID of the account of the sponsor-to-be.89 /// - `sponsor_id`: the account of the sponsor-to-be.90 /// - `contract_address`: ID of the modified contract.90 /// - `contract_address`: the address of the modified contract.91 fn set_sponsor(91 fn set_sponsor(92 sponsor_id: Self::AccountId,92 sponsor_id: Self::AccountId,93 contract_address: Self::ContractId,93 contract_address: Self::ContractId,94 ) -> DispatchResult;94 ) -> DispatchResult;959596 /// Removes sponsor for a contract.96 /// Removes sponsor for a contract.97 ///97 ///98 /// - `contract_address`: ID of the modified contract.98 /// - `contract_address`: the address of the modified contract.99 fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult;99 fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult;100100101 /// Retuns the current sponsor for a contract if one is set.101 /// Retuns the current sponsor for a contract if one is set.102 ///102 ///103 /// - `contract_address`: ID of the contract.103 /// - `contract_address`: the contract address.104 fn sponsor(104 fn sponsor(105 contract_address: Self::ContractId,105 contract_address: Self::ContractId,106 ) -> Result<Option<Self::AccountId>, DispatchError>;106 ) -> Result<Option<Self::AccountId>, DispatchError>;