Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(blockifier): simplify the creation of 'validate_calldata' #2094

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions crates/blockifier/src/transaction/transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1729,21 +1729,20 @@ fn test_deploy_account_tx(
let actual_execution_info = deploy_account.execute(state, block_context, true, true).unwrap();

// Build expected validate call info.
// TODO(AvivG): When the AccountTransaction refactor is complete, simplify the creation of
// `validate_calldata` by accessing the DeployAccountTransaction directly, without match.
let validate_calldata = match &deploy_account.tx {
ApiExecutableTransaction::DeployAccount(tx) => Calldata(
let validate_calldata = if let ApiExecutableTransaction::DeployAccount(tx) = &deploy_account.tx
{
Calldata(
[
vec![tx.class_hash().0, tx.contract_address_salt().0],
vec![class_hash.clone().0, tx.contract_address_salt().0],
(*tx.constructor_calldata().0).clone(),
]
.concat()
.into(),
),
ApiExecutableTransaction::Invoke(_) | ApiExecutableTransaction::Declare(_) => {
panic!("Expected DeployAccount transaction.")
}
)
} else {
panic!("Expected DeployAccount transaction.")
};

let expected_gas_consumed = 0;
let expected_validate_call_info = expected_validate_call_info(
account_class_hash,
Expand Down
Loading