Skip to content

Commit

Permalink
fix: new funcs are in TypedEnvBackend trait
Browse files Browse the repository at this point in the history
  • Loading branch information
agryaznov committed Apr 6, 2022
1 parent 87a0e24 commit b77254c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/env/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,19 @@ pub fn code_hash<E>(account: &E::AccountId) -> Result<E::Hash>
where
E: Environment,
{
<EnvInstance as OnInstance>::on_instance(|instance| instance.code_hash::<E>(account))
<EnvInstance as OnInstance>::on_instance(|instance| {
TypedEnvBackend::code_hash::<E>(instance, account)
})
}

/// Retrieves the code hash of the currently executing contract.
pub fn own_code_hash<E>() -> Result<E::Hash>
where
E: Environment,
{
<EnvInstance as OnInstance>::on_instance(|instance| instance.own_code_hash::<E>())
<EnvInstance as OnInstance>::on_instance(|instance| {
TypedEnvBackend::own_code_hash::<E>(instance)
})
}

/// Checks whether the caller of the current contract is the origin of the whole call stack.
Expand Down

0 comments on commit b77254c

Please sign in to comment.