Unverified Commit 0b1be71a authored by Michael Müller's avatar Michael Müller Committed by GitHub
Browse files

Improve docs on transfer() + minimum_balance() (#540)

* Fix typo

* Make minimum_balance docs clearer

* Fix transfer() docs
parent 0bdbd54c
Pipeline #111805 passed with stages
in 7 minutes and 31 seconds
......@@ -169,7 +169,7 @@ where
})
}
/// Returns the minimum balance for the contracts chain.
/// Returns the minimum balance that is required for creating an account.
///
/// # Errors
///
......@@ -422,9 +422,11 @@ where
/// contract call or invoke a runtime function that performs the
/// transaction.
///
/// # Panics
/// # Errors
///
/// If the contract doesn't have sufficient funds.
/// - If the contract doesn't have sufficient funds.
/// - If the transfer would have brought the sender's total balance below the
/// subsistence threshold.
pub fn transfer<T>(destination: T::AccountId, value: T::Balance) -> Result<()>
where
T: Environment,
......
......@@ -210,7 +210,7 @@ pub trait TypedEnvBackend: EnvBackend {
/// For more details visit: [`ink_env::block_number`]
fn block_number<T: Environment>(&mut self) -> Result<T::BlockNumber>;
/// Returns the minimum balance of the contracts chain.
/// Returns the minimum balance that is required for creating an account.
///
/// # Note
///
......
......@@ -83,7 +83,7 @@ impl ChainSpec {
self.gas_price = OffBalance::new(&gas_price)
}
/// Returns the minimum balance for an account on the chain.
/// Returns the minimum balance that is required for creating an account.
pub fn minimum_balance<T>(&self) -> Result<T::Balance>
where
T: Environment,
......
......@@ -64,7 +64,7 @@ define_error_codes! {
/// The passed key does not exist in storage.
KeyNotFound = 3,
/// Transfer failed because it would have brought the sender's total balance
/// bwlow the subsistence threshold.
/// below the subsistence threshold.
BelowSubsistenceThreshold = 4,
/// Transfer failed for other not further specified reason. Most probably
/// reserved or locked balance of the sender that was preventing the transfer.
......
......@@ -32,7 +32,7 @@ pub enum Error {
/// The queried contract storage entry is missing.
KeyNotFound,
/// Transfer failed because it would have brought the sender's total balance
/// bwlow the subsistence threshold.
/// below the subsistence threshold.
BelowSubsistenceThreshold,
/// Transfer failed for other not further specified reason. Most probably
/// reserved or locked balance of the sender that was preventing the transfer.
......
......@@ -174,7 +174,7 @@ where
ink_env::block_number::<T>().expect("couldn't decode block number")
}
/// Returns the minimum balance for the contracts chain.
/// Returns the minimum balance that is required for creating an account.
///
/// # Note
///
......
Supports Markdown
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