Skip to content

Commit

Permalink
fixed wrong_self_convention clippy warning for is_ functions
Browse files Browse the repository at this point in the history
  • Loading branch information
agryaznov committed Feb 18, 2022
1 parent 4f76c30 commit a40fab1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/env/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ pub trait TypedEnvBackend: EnvBackend {
/// # Note
///
/// For more details visit: [`is_contract`][`crate::is_contract`]
fn is_contract<T>(&mut self, account: &T::AccountId) -> bool
fn is_contract<T>(&self, account: &T::AccountId) -> bool
where
T: Environment;

Expand All @@ -441,7 +441,7 @@ pub trait TypedEnvBackend: EnvBackend {
/// # Note
///
/// For more details visit: [`caller_is_origin`][`crate::caller_is_origin`]
fn caller_is_origin<T>(&mut self) -> bool
fn caller_is_origin<T>(&self) -> bool
where
T: Environment;
}
4 changes: 2 additions & 2 deletions crates/env/src/engine/experimental_off_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,15 @@ impl TypedEnvBackend for EnvInstance {
scale::Decode::decode(&mut &output[..]).map_err(Into::into)
}

fn is_contract<T>(&mut self, _account: &T::AccountId) -> bool
fn is_contract<T>(&self, _account: &T::AccountId) -> bool
where
T: Environment,
{
// always false, as off-chain environment does not support contract instantiation
false
}

fn caller_is_origin<T>(&mut self) -> bool
fn caller_is_origin<T>(&self) -> bool
where
T: Environment,
{
Expand Down
4 changes: 2 additions & 2 deletions crates/env/src/engine/off_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,15 @@ impl TypedEnvBackend for EnvInstance {
Ok((block.random::<T>(subject)?, block.number::<T>()?))
}

fn is_contract<T>(&mut self, _account: &T::AccountId) -> bool
fn is_contract<T>(&self, _account: &T::AccountId) -> bool
where
T: Environment,
{
// always false, as off-chain environment does not support contract instantiation
false
}

fn caller_is_origin<T>(&mut self) -> bool
fn caller_is_origin<T>(&self) -> bool
where
T: Environment,
{
Expand Down
4 changes: 2 additions & 2 deletions crates/env/src/engine/on_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ impl TypedEnvBackend for EnvInstance {
scale::Decode::decode(&mut &output[..]).map_err(Into::into)
}

fn is_contract<T>(&mut self, account_id: &T::AccountId) -> bool
fn is_contract<T>(&self, account_id: &T::AccountId) -> bool
where
T: Environment,
{
Expand All @@ -500,7 +500,7 @@ impl TypedEnvBackend for EnvInstance {
ext::is_contract(enc_account_id)
}

fn caller_is_origin<T>(&mut self) -> bool
fn caller_is_origin<T>(&self) -> bool
where
T: Environment,
{
Expand Down

0 comments on commit a40fab1

Please sign in to comment.