Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Apr 3, 2024
1 parent e2662ad commit 4c2ea7d
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 60 deletions.
5 changes: 1 addition & 4 deletions starknet-core/src/types/receipt_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions starknet-providers/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 5 additions & 5 deletions starknet-providers/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
32 changes: 11 additions & 21 deletions starknet-providers/src/sequencer/models/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -220,10 +214,8 @@ mod tests {

assert_eq!(
tx.sender_address,
Felt::from_hex(
"0x68922eb87daed71fc3099031e178b6534fc39a570022342e8c166024da893f5"
)
.unwrap()
Felt::from_hex("0x68922eb87daed71fc3099031e178b6534fc39a570022342e8c166024da893f5")
.unwrap()
);
}

Expand All @@ -243,10 +235,8 @@ mod tests {

assert_eq!(
tx.contract_address,
Felt::from_hex(
"0x4c5772d1914fe6ce891b64eb35bf3522aeae1315647314aac58b01137607f3f"
)
.unwrap()
Felt::from_hex("0x4c5772d1914fe6ce891b64eb35bf3522aeae1315647314aac58b01137607f3f")
.unwrap()
);
}

Expand Down
12 changes: 4 additions & 8 deletions starknet-providers/src/sequencer/models/state_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}

Expand Down
6 changes: 2 additions & 4 deletions starknet-providers/src/sequencer/models/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,8 @@ mod tests {
assert_eq!(
tx.block_hash,
Some(
Felt::from_hex(
"0x13b390a0b2c48f907cda28c73a12aa31b96d51bc1be004ba5f71174d8d70e4f"
)
.unwrap()
Felt::from_hex("0x13b390a0b2c48f907cda28c73a12aa31b96d51bc1be004ba5f71174d8d70e4f")
.unwrap()
)
);
}
Expand Down
10 changes: 5 additions & 5 deletions starknet-providers/src/sequencer/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 4 additions & 8 deletions starknet-providers/tests/jsonrpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 4c2ea7d

Please sign in to comment.