Skip to content

Commit 227d1bf

Browse files
committed
fix: new funcs are in TypedEnvBackend trait
1 parent 87a0e24 commit 227d1bf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

crates/env/src/api.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,19 +515,27 @@ where
515515
}
516516

517517
/// Retrieves the code hash of the contract at the specified account id.
518+
///
519+
/// # Errors
520+
///
521+
/// If no code hash found for the specified account id.
518522
pub fn code_hash<E>(account: &E::AccountId) -> Result<E::Hash>
519523
where
520524
E: Environment,
521525
{
522-
<EnvInstance as OnInstance>::on_instance(|instance| instance.code_hash::<E>(account))
526+
<EnvInstance as OnInstance>::on_instance(|instance| {
527+
TypedEnvBackend::code_hash::<E>(instance, account)
528+
})
523529
}
524530

525531
/// Retrieves the code hash of the currently executing contract.
526532
pub fn own_code_hash<E>() -> Result<E::Hash>
527533
where
528534
E: Environment,
529535
{
530-
<EnvInstance as OnInstance>::on_instance(|instance| instance.own_code_hash::<E>())
536+
<EnvInstance as OnInstance>::on_instance(|instance| {
537+
TypedEnvBackend::own_code_hash::<E>(instance)
538+
})
531539
}
532540

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

0 commit comments

Comments
 (0)