We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d5f0b2 commit 72209a4Copy full SHA for 72209a4
frame/evm/src/lib.rs
@@ -929,6 +929,13 @@ impl<T: Config> Pallet<T> {
929
/// Get the account metadata (hash and size) from storage if it exists,
930
/// or compute it from code and store it if it doesn't exist.
931
pub fn account_code_metadata(address: H160) -> CodeMetadata {
932
+ if let Some(code) = <T as Config>::OnMethodCall::get_code(&address) {
933
+ return CodeMetadata {
934
+ size: code.len() as u64,
935
+ // TODO: Store code hash in OnMethodCall
936
+ hash: H256::from(sp_io::hashing::keccak_256(&code)),
937
+ };
938
+ }
939
if let Some(meta) = <AccountCodesMetadata<T>>::get(address) {
940
return meta;
941
}
0 commit comments