Skip to content

Commit

Permalink
fix: update test due to Cairo 0 declaration support
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Sep 5, 2024
1 parent 6505c11 commit 835c026
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/blockifier/src/blockifier/transaction_executor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ fn tx_executor_test_body<S: StateReader>(
TransactionVersion::ZERO,
CairoVersion::Cairo0,
BouncerWeights {
state_diff_size: 0,
// The state diff size is 2 because to support declaring Cairo0 contracts, we
// need to include the compiled class hash and declared contracts of the Cairo
// 0 contract in the state diff.
state_diff_size: 2,
message_segment_length: 0,
n_events: 0,
..Default::default()
Expand All @@ -66,7 +69,7 @@ fn tx_executor_test_body<S: StateReader>(
TransactionVersion::ONE,
CairoVersion::Cairo0,
BouncerWeights {
state_diff_size: 2,
state_diff_size: 4,
message_segment_length: 0,
n_events: 0,
..Default::default()
Expand Down
3 changes: 3 additions & 0 deletions crates/blockifier/src/transaction/transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,9 @@ fn declare_expected_state_changes_count(version: TransactionVersion) -> StateCha
StateChangesCount {
n_storage_updates: 1, // Sender balance.
n_modified_contracts: 1, // Nonce.
// Supposed to be ZERO, but because due to the changes made for supporting declaring
// Cairo 0 contracts, `n_compiled_class_hash_updates` is 1 for V0 declare transactions.
n_compiled_class_hash_updates: 1, // Also set compiled class hash.
..StateChangesCount::default()
}
} else if version == TransactionVersion::TWO || version == TransactionVersion::THREE {
Expand Down

0 comments on commit 835c026

Please sign in to comment.