From 2e9a68b66b6e58dfabd198f7c4f3b8e9d26ec62a Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 11 Sep 2025 12:11:16 +0200 Subject: [PATCH] fix: check codehash empty instead bytecode --- crates/precompiles/src/contracts/tip_account_registrar.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/precompiles/src/contracts/tip_account_registrar.rs b/crates/precompiles/src/contracts/tip_account_registrar.rs index fe587dae80..1c0aa69ecb 100644 --- a/crates/precompiles/src/contracts/tip_account_registrar.rs +++ b/crates/precompiles/src/contracts/tip_account_registrar.rs @@ -47,9 +47,7 @@ impl<'a, S: StorageProvider> TipAccountRegistrar<'a, S> { )); } - let code = account_info.code.unwrap_or_default(); - - if !code.is_empty() { + if !account_info.is_empty_code_hash() { return Err(TipAccountRegistrarError::CodeNotEmpty( ITipAccountRegistrar::CodeNotEmpty {}, )); @@ -221,6 +219,6 @@ mod tests { let account_info_after = storage .get_account_info(expected_address) .expect("Failed to get account info"); - assert_eq!(account_info_after.code, None); + assert!(account_info_after.is_empty_code_hash()); } }