diff --git a/starknet-core/src/types/receipt_block.rs b/starknet-core/src/types/receipt_block.rs index 23a45061..4287e2e6 100644 --- a/starknet-core/src/types/receipt_block.rs +++ b/starknet-core/src/types/receipt_block.rs @@ -7,10 +7,7 @@ use starknet_types_core::felt::Felt; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ReceiptBlock { Pending, - Block { - block_hash: Felt, - block_number: u64, - }, + Block { block_hash: Felt, block_number: u64 }, } impl ReceiptBlock { diff --git a/starknet-providers/src/any.rs b/starknet-providers/src/any.rs index b5953b08..993757ad 100644 --- a/starknet-providers/src/any.rs +++ b/starknet-providers/src/any.rs @@ -3,11 +3,11 @@ use starknet_core::types::{ BlockHashAndNumber, BlockId, BroadcastedDeclareTransaction, BroadcastedDeployAccountTransaction, BroadcastedInvokeTransaction, BroadcastedTransaction, ContractClass, DeclareTransactionResult, DeployAccountTransactionResult, EventFilter, - EventsPage, FeeEstimate, FunctionCall, InvokeTransactionResult, - MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, - MaybePendingStateUpdate, MsgFromL1, SimulatedTransaction, SimulationFlag, - SimulationFlagForEstimateFee, SyncStatusType, Transaction, TransactionReceiptWithBlockInfo, - TransactionStatus, TransactionTrace, TransactionTraceWithHash, + EventsPage, FeeEstimate, FunctionCall, InvokeTransactionResult, MaybePendingBlockWithReceipts, + MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, MaybePendingStateUpdate, MsgFromL1, + SimulatedTransaction, SimulationFlag, SimulationFlagForEstimateFee, SyncStatusType, + Transaction, TransactionReceiptWithBlockInfo, TransactionStatus, TransactionTrace, + TransactionTraceWithHash, }; use starknet_types_core::felt::Felt; diff --git a/starknet-providers/src/provider.rs b/starknet-providers/src/provider.rs index 471a8ebc..817c39bc 100644 --- a/starknet-providers/src/provider.rs +++ b/starknet-providers/src/provider.rs @@ -4,11 +4,11 @@ use starknet_core::types::{ BlockHashAndNumber, BlockId, BroadcastedDeclareTransaction, BroadcastedDeployAccountTransaction, BroadcastedInvokeTransaction, BroadcastedTransaction, ContractClass, DeclareTransactionResult, DeployAccountTransactionResult, EventFilter, - EventsPage, FeeEstimate, FunctionCall, InvokeTransactionResult, - MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, - MaybePendingStateUpdate, MsgFromL1, SimulatedTransaction, SimulationFlag, - SimulationFlagForEstimateFee, StarknetError, SyncStatusType, Transaction, - TransactionReceiptWithBlockInfo, TransactionStatus, TransactionTrace, TransactionTraceWithHash, + EventsPage, FeeEstimate, FunctionCall, InvokeTransactionResult, MaybePendingBlockWithReceipts, + MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, MaybePendingStateUpdate, MsgFromL1, + SimulatedTransaction, SimulationFlag, SimulationFlagForEstimateFee, StarknetError, + SyncStatusType, Transaction, TransactionReceiptWithBlockInfo, TransactionStatus, + TransactionTrace, TransactionTraceWithHash, }; use starknet_types_core::felt::Felt; use std::{any::Any, error::Error, fmt::Debug}; diff --git a/starknet-providers/src/sequencer/models/block.rs b/starknet-providers/src/sequencer/models/block.rs index 0c1f79ca..4fa215b4 100644 --- a/starknet-providers/src/sequencer/models/block.rs +++ b/starknet-providers/src/sequencer/models/block.rs @@ -2,7 +2,7 @@ use serde::Deserialize; use serde_with::serde_as; use starknet_core::{ serde::unsigned_field_element::{UfeHex, UfeHexOption}, - types::{ L1DataAvailabilityMode, ResourcePrice}, + types::{L1DataAvailabilityMode, ResourcePrice}, }; use starknet_types_core::felt::Felt; @@ -83,24 +83,18 @@ mod tests { assert_eq!(block.status, BlockStatus::AcceptedOnL1); assert_eq!( block.state_root.unwrap(), - Felt::from_hex( - "051098918fd96edda4e251f695181c063e21fb0666352e3469db507c7fd62b89" - ) - .unwrap() + Felt::from_hex("051098918fd96edda4e251f695181c063e21fb0666352e3469db507c7fd62b89") + .unwrap() ); assert_eq!( block.transaction_commitment.unwrap(), - FFelt::from_hex( - "0576db32d35cf011694a73c6ce400d5d77f768cbd77ee7cf87d12902e0f9b4ec" - ) - .unwrap() + FFelt::from_hex("0576db32d35cf011694a73c6ce400d5d77f768cbd77ee7cf87d12902e0f9b4ec") + .unwrap() ); assert_eq!( block.event_commitment.unwrap(), - Felt::from_hex_be( - "01c972780140fd16dde94639226ca25818e4f24ecd5b5c3065cc1f5f5fc410f9" - ) - .unwrap() + Felt::from_hex_be("01c972780140fd16dde94639226ca25818e4f24ecd5b5c3065cc1f5f5fc410f9") + .unwrap() ); assert_eq!(block.transactions.len(), 4); assert_eq!(block.transaction_receipts.len(), 4); @@ -220,10 +214,8 @@ mod tests { assert_eq!( tx.sender_address, - Felt::from_hex( - "0x68922eb87daed71fc3099031e178b6534fc39a570022342e8c166024da893f5" - ) - .unwrap() + Felt::from_hex("0x68922eb87daed71fc3099031e178b6534fc39a570022342e8c166024da893f5") + .unwrap() ); } @@ -243,10 +235,8 @@ mod tests { assert_eq!( tx.contract_address, - Felt::from_hex( - "0x4c5772d1914fe6ce891b64eb35bf3522aeae1315647314aac58b01137607f3f" - ) - .unwrap() + Felt::from_hex("0x4c5772d1914fe6ce891b64eb35bf3522aeae1315647314aac58b01137607f3f") + .unwrap() ); } diff --git a/starknet-providers/src/sequencer/models/state_update.rs b/starknet-providers/src/sequencer/models/state_update.rs index 35c85ada..c3892956 100644 --- a/starknet-providers/src/sequencer/models/state_update.rs +++ b/starknet-providers/src/sequencer/models/state_update.rs @@ -88,17 +88,13 @@ mod tests { assert_eq!( storage_diff.key, - Felt::from_hex( - "0x34c0d833897dbc937dd35e9f49a5184aecd6ab47829de999f9587549f82d0e" - ) - .unwrap() + Felt::from_hex("0x34c0d833897dbc937dd35e9f49a5184aecd6ab47829de999f9587549f82d0e") + .unwrap() ); assert_eq!( storage_diff.value, - Felt::from_hex( - "0x74fd8ca6e84097ad9ae00febfb690ad032fc4477155ec2193382c1b30b5e12b" - ) - .unwrap() + Felt::from_hex("0x74fd8ca6e84097ad9ae00febfb690ad032fc4477155ec2193382c1b30b5e12b") + .unwrap() ); } diff --git a/starknet-providers/src/sequencer/models/transaction.rs b/starknet-providers/src/sequencer/models/transaction.rs index fba8ae43..01796304 100644 --- a/starknet-providers/src/sequencer/models/transaction.rs +++ b/starknet-providers/src/sequencer/models/transaction.rs @@ -461,10 +461,8 @@ mod tests { assert_eq!( tx.block_hash, Some( - Felt::from_hex( - "0x13b390a0b2c48f907cda28c73a12aa31b96d51bc1be004ba5f71174d8d70e4f" - ) - .unwrap() + Felt::from_hex("0x13b390a0b2c48f907cda28c73a12aa31b96d51bc1be004ba5f71174d8d70e4f") + .unwrap() ) ); } diff --git a/starknet-providers/src/sequencer/provider.rs b/starknet-providers/src/sequencer/provider.rs index 52bb8965..c6cca546 100644 --- a/starknet-providers/src/sequencer/provider.rs +++ b/starknet-providers/src/sequencer/provider.rs @@ -7,11 +7,11 @@ use starknet_core::types::{ BlockHashAndNumber, BlockId, BroadcastedDeclareTransaction, BroadcastedDeployAccountTransaction, BroadcastedInvokeTransaction, BroadcastedTransaction, ContractClass, DeclareTransactionResult, DeployAccountTransactionResult, EventFilter, - EventsPage, FeeEstimate, FunctionCall, InvokeTransactionResult, - MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, - MaybePendingStateUpdate, MsgFromL1, SimulatedTransaction, SimulationFlag, - SimulationFlagForEstimateFee, StarknetError, SyncStatusType, Transaction, - TransactionReceiptWithBlockInfo, TransactionStatus, TransactionTrace, TransactionTraceWithHash, + EventsPage, FeeEstimate, FunctionCall, InvokeTransactionResult, MaybePendingBlockWithReceipts, + MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, MaybePendingStateUpdate, MsgFromL1, + SimulatedTransaction, SimulationFlag, SimulationFlagForEstimateFee, StarknetError, + SyncStatusType, Transaction, TransactionReceiptWithBlockInfo, TransactionStatus, + TransactionTrace, TransactionTraceWithHash, }; use starknet_types_core::felt::Felt; diff --git a/starknet-providers/tests/jsonrpc.rs b/starknet-providers/tests/jsonrpc.rs index 701b21db..1feb3d2f 100644 --- a/starknet-providers/tests/jsonrpc.rs +++ b/starknet-providers/tests/jsonrpc.rs @@ -273,10 +273,8 @@ async fn jsonrpc_get_transaction_by_hash_declare_v3() { let tx = rpc_client .get_transaction_by_hash( - Felt::from_hex_be( - "054270d103c875a613e013d1fd555edcff2085feca9d7b4532243a8257fd5cf3", - ) - .unwrap(), + Felt::from_hex_be("054270d103c875a613e013d1fd555edcff2085feca9d7b4532243a8257fd5cf3") + .unwrap(), ) .await .unwrap(); @@ -318,10 +316,8 @@ async fn jsonrpc_get_transaction_by_hash_deploy_account_v3() { let tx = rpc_client .get_transaction_by_hash( - Felt::from_hex_be( - "011c67fb3a9a623b3190c9ac41ebf7f5dd421f2583344c498a30a7280c660f01", - ) - .unwrap(), + Felt::from_hex_be("011c67fb3a9a623b3190c9ac41ebf7f5dd421f2583344c498a30a7280c660f01") + .unwrap(), ) .await .unwrap();