diff --git a/crates/blockifier/src/transaction/transactions.rs b/crates/blockifier/src/transaction/transactions.rs index 1f38cfc0187..d6b97b482e1 100644 --- a/crates/blockifier/src/transaction/transactions.rs +++ b/crates/blockifier/src/transaction/transactions.rs @@ -280,15 +280,13 @@ impl TransactionInfoCreator for DeclareTransaction { } #[derive(Debug, Clone)] pub struct DeployAccountTransaction { - pub tx: starknet_api::transaction::DeployAccountTransaction, - pub tx_hash: TransactionHash, - pub contract_address: ContractAddress, + pub tx: starknet_api::executable_transaction::DeployAccountTransaction, // Indicates the presence of the only_query bit in the version. pub only_query: bool, } impl Deref for DeployAccountTransaction { - type Target = starknet_api::transaction::DeployAccountTransaction; + type Target = starknet_api::executable_transaction::DeployAccountTransaction; fn deref(&self) -> &Self::Target { &self.tx @@ -301,7 +299,14 @@ impl DeployAccountTransaction { tx_hash: TransactionHash, contract_address: ContractAddress, ) -> Self { - Self { tx: deploy_account_tx, tx_hash, contract_address, only_query: false } + Self { + tx: starknet_api::executable_transaction::DeployAccountTransaction { + tx: deploy_account_tx, + tx_hash, + contract_address, + }, + only_query: false, + } } pub fn new_for_query( @@ -309,7 +314,14 @@ impl DeployAccountTransaction { tx_hash: TransactionHash, contract_address: ContractAddress, ) -> Self { - Self { tx: deploy_account_tx, tx_hash, contract_address, only_query: true } + Self { + tx: starknet_api::executable_transaction::DeployAccountTransaction { + tx: deploy_account_tx, + tx_hash, + contract_address, + }, + only_query: true, + } } pub fn tx(&self) -> &starknet_api::transaction::DeployAccountTransaction { @@ -357,7 +369,7 @@ impl TransactionInfoCreator for DeployAccountTransaction { only_query: self.only_query, }; - match &self.tx { + match &self.tx.tx { starknet_api::transaction::DeployAccountTransaction::V1(tx) => { TransactionInfo::Deprecated(DeprecatedTransactionInfo { common_fields, diff --git a/crates/starknet_api/src/executable_transaction.rs b/crates/starknet_api/src/executable_transaction.rs index 40ac70a97ae..9bc1f63000e 100644 --- a/crates/starknet_api/src/executable_transaction.rs +++ b/crates/starknet_api/src/executable_transaction.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use crate::core::{ContractAddress, Nonce}; use crate::state::ContractClass; use crate::transaction::{Tip, TransactionHash}; @@ -68,6 +70,14 @@ pub struct DeployAccountTransaction { pub contract_address: ContractAddress, } +impl Deref for DeployAccountTransaction { + type Target = crate::transaction::DeployAccountTransaction; + + fn deref(&self) -> &Self::Target { + &self.tx + } +} + #[derive(Clone, Debug, Eq, PartialEq)] pub struct InvokeTransaction { pub tx: crate::transaction::InvokeTransaction,