Skip to content
Snippets Groups Projects
Commit 68e25132 authored by Kevin Wang's avatar Kevin Wang Committed by GitHub
Browse files

Export fn code_hash (#12479)

Co-authored-by: parity-processbot <>
parent 0e729f23
Branches
No related merge requests found
......@@ -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(
......
......@@ -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)
}
......
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