Skip to content

Commit

Permalink
feat: explicit object/trait imports for felt macro (#270)
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <[email protected]>
  • Loading branch information
dorimedini-starkware authored Jun 4, 2024
1 parent 3256ea2 commit f62b1aa
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starknet_api"
version = "0.13.0-dev.2"
version = "0.13.0-dev.3"
edition = "2021"
repository = "https://github.com/starkware-libs/starknet-api"
license = "Apache-2.0"
Expand Down
1 change: 0 additions & 1 deletion src/block_hash/block_hash_calculator_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::block_hash::test_utils::{get_state_diff, get_transaction_output};
use crate::core::{ContractAddress, GlobalRoot, PatriciaKey, SequencerContractAddress};
use crate::data_availability::L1DataAvailabilityMode;
use crate::felt;
use crate::hash::{FeltConverter, TryIntoFelt};
use crate::transaction::{TransactionHash, TransactionSignature};

#[test]
Expand Down
1 change: 0 additions & 1 deletion src/block_hash/event_commitment_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use starknet_types_core::hash::Poseidon;

use super::{calculate_event_hash, calculate_events_commitment, EventLeafElement};
use crate::core::{ContractAddress, EventCommitment, PatriciaKey};
use crate::hash::{FeltConverter, TryIntoFelt};
use crate::transaction::{Event, EventContent, EventData, EventKey, TransactionHash};
use crate::{contract_address, felt, patricia_key};

Expand Down
1 change: 0 additions & 1 deletion src/block_hash/receipt_commitment_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::block_hash::receipt_commitment::{
use crate::block_hash::test_utils::{generate_message_to_l1, get_transaction_output};
use crate::core::ReceiptCommitment;
use crate::felt;
use crate::hash::{FeltConverter, TryIntoFelt};
use crate::transaction::{
RevertedTransactionExecutionStatus, TransactionExecutionStatus, TransactionHash,
};
Expand Down
2 changes: 1 addition & 1 deletion src/block_hash/state_diff_hash_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::block_hash::test_utils::get_state_diff;
use crate::core::{ClassHash, CompiledClassHash, Nonce, StateDiffCommitment};
use crate::crypto::utils::HashChain;
use crate::felt;
use crate::hash::{FeltConverter, PoseidonHash, TryIntoFelt};
use crate::hash::PoseidonHash;

#[test]
fn test_state_diff_hash_regression() {
Expand Down
1 change: 0 additions & 1 deletion src/block_hash/transaction_commitment_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::block_hash::transaction_commitment::{
};
use crate::core::TransactionCommitment;
use crate::felt;
use crate::hash::{FeltConverter, TryIntoFelt};
use crate::transaction::{TransactionHash, TransactionSignature};

#[test]
Expand Down
1 change: 0 additions & 1 deletion src/block_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::block::{BlockHash, BlockNumber, BlockSignature};
use crate::core::{GlobalRoot, SequencerPublicKey};
use crate::crypto::utils::{PublicKey, Signature};
use crate::felt;
use crate::hash::{FeltConverter, TryIntoFelt};

#[test]
fn test_block_number_iteration() {
Expand Down
2 changes: 1 addition & 1 deletion src/core_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::core::{
calculate_contract_address, ClassHash, ContractAddress, EthAddress, Nonce, PatriciaKey,
StarknetApiError, CONTRACT_ADDRESS_PREFIX, L2_ADDRESS_UPPER_BOUND,
};
use crate::hash::{FeltConverter, StarkHash, TryIntoFelt};
use crate::hash::StarkHash;
use crate::transaction::{Calldata, ContractAddressSalt};
use crate::{class_hash, felt, patricia_key};

Expand Down
1 change: 0 additions & 1 deletion src/crypto/crypto_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use starknet_types_core::hash::{Poseidon, StarkHash};

use crate::crypto::utils::{verify_message_hash_signature, PublicKey, Signature};
use crate::felt;
use crate::hash::{FeltConverter, TryIntoFelt};

#[test]
fn signature_verification() {
Expand Down
1 change: 0 additions & 1 deletion src/crypto/patricia_hash_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use starknet_types_core::hash::Poseidon;

use super::calculate_root;
use crate::felt;
use crate::hash::{FeltConverter, TryIntoFelt};

#[test]
fn test_patricia_regression() {
Expand Down
1 change: 0 additions & 1 deletion src/external_transaction_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::external_transaction::{
ExternalDeployAccountTransaction, ExternalDeployAccountTransactionV3,
ExternalInvokeTransaction, ExternalInvokeTransactionV3, ExternalTransaction,
};
use crate::hash::{FeltConverter, TryIntoFelt};
use crate::transaction::{
AccountDeploymentData, Calldata, ContractAddressSalt, PaymasterData, Resource, ResourceBounds,
ResourceBoundsMapping, Tip, TransactionSignature,
Expand Down
2 changes: 1 addition & 1 deletion src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ impl TryIntoFelt<&str> for FeltConverter {
#[macro_export]
macro_rules! felt {
($s:expr) => {
FeltConverter::to_felt_unchecked($s)
<$crate::hash::FeltConverter as $crate::hash::TryIntoFelt<_>>::to_felt_unchecked($s)
};
}

0 comments on commit f62b1aa

Please sign in to comment.