Export fn code_hash (#12479)

Co-authored-by: parity-processbot <>
This commit is contained in:
Kevin Wangandparity-processbot authored and GitHub committed 2022-10-17 06:27:24 +00:00
1 parent 0e729f2327
commit 68e2513265
2 files changed
+5 -1

No files matched your search

+5
View File
@@ -1031,6 +1031,11 @@ where
T::AddressGenerator::generate_address(deploying_address, code_hash, salt)
}
/// Returns the code hash of the contract specified by `account` ID.
pub fn code_hash(account: &AccountIdOf<T>) -> Option<CodeHash<T>> {
Storage::<T>::code_hash(account)
}
/// Store code for benchmarks which does not check nor instrument the code.
#[cfg(feature = "runtime-benchmarks")]
fn store_code_raw(
-1
View File
@@ -328,7 +328,6 @@ where
}
/// Returns the code hash of the contract specified by `account` ID.
#[cfg(test)]
pub fn code_hash(account: &AccountIdOf<T>) -> Option<CodeHash<T>> {
<ContractInfoOf<T>>::get(account).map(|i| i.code_hash)
}