Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Jun 5, 2023
1 parent 7a18716 commit fe940ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions frame/contracts/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,17 @@ impl<T: Config> ContractInfo<T> {
}

/// Set and returns the contract base deposit.
/// `code_len` is the length of the code that is instantiated.
/// `upload_deposit` is the balance of the deposit paid for uploading the contract.
pub fn update_base_deposit(&mut self, upload_deposit: BalanceOf<T>) -> BalanceOf<T> {
let ed = Pallet::<T>::min_balance();
let info_deposit =
Diff { bytes_added: self.encoded_size() as u32, items_added: 1, ..Default::default() }
.update_contract::<T>(None)
.charge_or_zero();

// Instantiating the contract, prevent it to be deleted, therefore the base deposit includes
// a fraction (`T::CodeHashLockupDepositPercent`) of the original storage deposit to prevent
// abuse.
let upload_deposit = T::CodeHashLockupDepositPercent::get().mul_ceil(upload_deposit);

// Instantiate needs to transfer at least the minimum balance in order to pull the
Expand All @@ -236,11 +239,11 @@ impl<T: Config> ContractInfo<T> {
deposit
}

/// Add a new `code_hash` dependency to the contract.
/// Add a new delegate dependency to the contract.
/// The `amount` is the amount of funds that will be reserved for the dependency.
///
/// Returns an error if the maximum number of delegate_dependencies is reached or if
/// the dependency already exists.
/// the delegate dependency already exists.
pub fn add_delegate_dependency(
&mut self,
code_hash: CodeHash<T>,
Expand All @@ -253,9 +256,9 @@ impl<T: Config> ContractInfo<T> {
.map_err(Into::into)
}

/// Remove a `code_hash` dependency from the contract.
/// Remove a delegate dependency from the contract.
///
/// Returns an error if the dependency doesn't exist.
/// Returns an error if the entry doesn't exist.
pub fn remove_delegate_dependency(
&mut self,
code_hash: &CodeHash<T>,
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/src/wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl<T: Config> OwnerInfo<T> {
self.refcount
}

/// Return the deposit of the module.
/// Returns the deposit of the module.
pub fn deposit(&self) -> BalanceOf<T> {
self.deposit
}
Expand Down

0 comments on commit fe940ac

Please sign in to comment.