You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
If you try to get the compiled class hash after executing a declare tx, you will get a NoneCompiledHash error. This is what i try to do in the contract_execution example:
//* --------------------------------------------//* Declare new contract class//* --------------------------------------------let declare_tx = Declare::new_with_tx_hash(&sierra_contract_class,Some(casm_class),
compiled_class_hash,
account_contract_address.clone(),Default::default(),// max fee2.into(),
signature.clone(),1.into(),// nonce// Value hardcoded to pass signature validation2718.into(),).expect("couldn't create declare transaction");let class_hash = declare_tx.sierra_class_hash;
declare_tx
.execute(&mut state,&block_context,#[cfg(feature = "cairo-native")]None,).expect("could not declare the contract class");// This will return `NoneCompiledHash` errorlet actual_compiled_class_hash = state
.get_compiled_class_hash(&(class_hash.into())).expect("should have compiled class hash");
this probably what caused it, here it sets the compiled hash in cache.compiled_hash_writes:
if i replace line 179 above with self.cache.get_compiled_class_hash(class_hash), which reads from the compiled_class_hash_writes field, the issue is fixed.
The text was updated successfully, but these errors were encountered:
If you try to get the compiled class hash after executing a declare tx, you will get a
NoneCompiledHash
error. This is what i try to do in thecontract_execution
example:this probably what caused it, here it sets the compiled hash in
cache.compiled_hash_writes
:starknet_in_rust/src/state/cached_state.rs
Lines 306 to 318 in 370d406
but the
get_compiled_class_hash()
implementation doesn't read from it, but instead fromcache.class_hash_to_compiled_class_hash
:starknet_in_rust/src/state/cached_state.rs
Lines 177 to 185 in 370d406
if i replace line 179 above with
self.cache.get_compiled_class_hash(class_hash)
, which reads from thecompiled_class_hash_writes
field, the issue is fixed.The text was updated successfully, but these errors were encountered: