diff --git a/crates/client/rpc-core/src/lib.rs b/crates/client/rpc-core/src/lib.rs index 9b6c65d1d..68126b392 100644 --- a/crates/client/rpc-core/src/lib.rs +++ b/crates/client/rpc-core/src/lib.rs @@ -52,15 +52,15 @@ pub struct DeclareV0Result { /// /// **declare_transaction** : DeclareTransactionV0V1 struct constructed before calling. /// -/// **program_vec** : Program vector is program from `ClassInfo` struct converted into Vector. +/// **program_bytes** : Program bytes is program from `ClassInfo` struct converted into Vector. /// /// **entrypoints** : Entrypoints are taken from `ClassInfo` struct. /// /// **abi_length** : ABI length calculated from abi in `LegacyContractClass`. -#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] +#[derive(Serialize, Deserialize, Debug)] pub struct CustomDeclareV0Transaction { pub declare_transaction: DeclareTransactionV0V1, - pub program_vec: Vec, + pub program_bytes: Vec, pub entrypoints: IndexMap>, pub abi_length: usize, } diff --git a/crates/client/rpc/src/lib.rs b/crates/client/rpc/src/lib.rs index 159fc0d2e..25ced0318 100644 --- a/crates/client/rpc/src/lib.rs +++ b/crates/client/rpc/src/lib.rs @@ -316,7 +316,7 @@ where async fn declare_v0_contract(&self, params: mc_rpc_core::CustomDeclareV0Transaction) -> RpcResult { let txn_hash: TransactionHash = self.get_txn_hash(params.declare_transaction.clone()); - let program_decoded = Program::decode_all(&mut params.program_vec.as_slice()).map_err(|e| { + let program_decoded = Program::decode_all(&mut params.program_bytes.as_slice()).map_err(|e| { log::debug!("error: {:?}", e); StarknetRpcApiError::InternalServerError })?; diff --git a/crates/client/rpc/src/types.rs b/crates/client/rpc/src/types.rs index c2fdde916..c098eb436 100644 --- a/crates/client/rpc/src/types.rs +++ b/crates/client/rpc/src/types.rs @@ -1,11 +1,7 @@ use std::num::ParseIntError; use std::{fmt, u64}; -use indexmap::IndexMap; use mp_felt::Felt252Wrapper; -use serde::{Deserialize, Serialize}; -use starknet_api::deprecated_contract_class::{EntryPoint, EntryPointType}; -use starknet_api::transaction::DeclareTransactionV0V1; use starknet_ff::FieldElement; pub struct RpcEventFilter { @@ -29,24 +25,6 @@ pub enum ParseTokenError { ParseFailed(ParseIntError), } -/// CustomDeclareV0Transaction -/// This will be given as an input to the rpc body -/// -/// **declare_transaction** : DeclareTransactionV0V1 struct constructed before calling. -/// -/// **program_vec** : Program vector is program from `ClassInfo` struct converted into Vector. -/// -/// **entrypoints** : Entrypoints are taken from `ClassInfo` struct. -/// -/// **abi_length** : ABI length calculated from abi in `LegacyContractClass`. -#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] -pub struct CustomDeclareV0Transaction { - pub declare_transaction: DeclareTransactionV0V1, - pub program_vec: Vec, - pub entrypoints: IndexMap>, - pub abi_length: usize, -} - impl fmt::Display for ContinuationToken { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:x},{:x}", self.block_n, self.event_n)