Skip to content

Commit

Permalink
fix: codehash commitment
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Nov 4, 2024
1 parent 6cbc820 commit 193cb4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cairo_zero/backend/starknet.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ namespace Internals {
if (starknet_account_exists == 0) {
// Deploy account
Starknet.deploy(self.address.evm);
// Commit the code hash upon deployment
// of a new account, in all cases.
// Retrieved in `fetch_or_create` in the next transaction.
IAccount.set_code_hash(starknet_address, [self.code_hash]);

Check warning on line 183 in cairo_zero/backend/starknet.cairo

View check run for this annotation

Codecov / codecov/patch

cairo_zero/backend/starknet.cairo#L183

Added line #L183 was not covered by tests
tempvar syscall_ptr = syscall_ptr;
tempvar pedersen_ptr = pedersen_ptr;
tempvar range_check_ptr = range_check_ptr;
Expand All @@ -201,7 +205,6 @@ namespace Internals {

let has_code_or_nonce = Account.has_code_or_nonce(self);
if (has_code_or_nonce == FALSE) {
// Nothing to commit
return ();
}

Expand Down

0 comments on commit 193cb4b

Please sign in to comment.