Skip to content

Commit

Permalink
chore: remove redundent try_from methods for declare transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Aug 18, 2024
1 parent 85e18ed commit 45bd013
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions crates/blockifier/src/transaction/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,6 @@ pub struct DeclareTransaction {
pub class_info: ClassInfo,
}

impl TryFrom<starknet_api::executable_transaction::DeclareTransaction> for DeclareTransaction {
type Error = TransactionExecutionError;

fn try_from(
declare_tx: starknet_api::executable_transaction::DeclareTransaction,
) -> Result<Self, Self::Error> {
Self::new_from_executable_tx(declare_tx, false)
}
}

impl DeclareTransaction {
fn create(
declare_tx: starknet_api::transaction::DeclareTransaction,
Expand Down Expand Up @@ -173,17 +163,6 @@ impl DeclareTransaction {
Self::create(declare_tx, tx_hash, class_info, true)
}

fn new_from_executable_tx(
declare_tx: starknet_api::executable_transaction::DeclareTransaction,
only_query: bool,
) -> Result<Self, TransactionExecutionError> {
let starknet_api::executable_transaction::DeclareTransaction { tx, tx_hash, class_info } =
declare_tx;
let class_info: ClassInfo = class_info.try_into()?;

Self::create(tx, tx_hash, class_info, only_query)
}

implement_inner_tx_getter_calls!(
(class_hash, ClassHash),
(nonce, Nonce),
Expand Down

0 comments on commit 45bd013

Please sign in to comment.