From 15219992b54b170dcf80fa5cceab56847ea2f7f0 Mon Sep 17 00:00:00 2001 From: yoavGrs <97383386+yoavGrs@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:19:35 +0300 Subject: [PATCH] feat: add derive features (#274) --- Cargo.toml | 2 +- src/block_hash/block_hash_calculator.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5fdc32b..3c79505 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_api" -version = "0.13.0-dev.5" +version = "0.13.0-dev.6" edition = "2021" repository = "https://github.com/starkware-libs/starknet-api" license = "Apache-2.0" diff --git a/src/block_hash/block_hash_calculator.rs b/src/block_hash/block_hash_calculator.rs index 28e3d3f..7b530d7 100644 --- a/src/block_hash/block_hash_calculator.rs +++ b/src/block_hash/block_hash_calculator.rs @@ -1,5 +1,5 @@ use once_cell::sync::Lazy; -use serde::Deserialize; +use serde::{Deserialize, Serialize}; use starknet_types_core::felt::Felt; use starknet_types_core::hash::Poseidon; @@ -27,7 +27,7 @@ static STARKNET_BLOCK_HASH0: Lazy = Lazy::new(|| { }); /// The common fields of transaction output types. -#[derive(Clone, Deserialize, PartialEq, Eq)] +#[derive(Clone, Debug, Deserialize, PartialEq, Eq)] pub struct TransactionOutputForHash { pub actual_fee: Fee, pub events: Vec, @@ -36,6 +36,7 @@ pub struct TransactionOutputForHash { pub messages_sent: Vec, } +#[derive(Clone, Debug, Deserialize, Eq, PartialEq)] pub struct TransactionHashingData { pub transaction_signature: Option, pub transaction_output: TransactionOutputForHash, @@ -43,6 +44,7 @@ pub struct TransactionHashingData { } /// Commitments of a block. +#[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub struct BlockHeaderCommitments { pub transactions_commitment: TransactionCommitment, pub events_commitment: EventCommitment,