Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 0436d04

Browse files
authored
Move ClassHash into transaction module (#1232)
* Move ClassHash into transaction module * fmt
1 parent 8f9b552 commit 0436d04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+169
-184
lines changed

bench/internals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use starknet_in_rust::{
1818
cached_state::CachedState, contract_class_cache::PermanentContractClassCache,
1919
in_memory_state_reader::InMemoryStateReader, state_api::State,
2020
},
21+
transaction::ClassHash,
2122
transaction::{declare::Declare, Address, Deploy, DeployAccount, InvokeFunction},
22-
utils::ClassHash,
2323
};
2424
use std::{hint::black_box, sync::Arc};
2525

bench/yas.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ use tracing_subscriber::{EnvFilter, FmtSubscriber};
3333
#[cfg(feature = "cairo-native")]
3434
use {
3535
cairo_native::cache::{AotProgramCache, JitProgramCache, ProgramCache},
36-
starknet_in_rust::utils::{get_native_context, ClassHash},
36+
starknet_in_rust::transaction::ClassHash,
37+
starknet_in_rust::utils::get_native_context,
3738
std::{cell::RefCell, rc::Rc},
3839
};
3940

@@ -989,7 +990,7 @@ mod utils {
989990
in_memory_state_reader::InMemoryStateReader, state_api::State,
990991
},
991992
transaction::Address,
992-
utils::ClassHash,
993+
transaction::ClassHash,
993994
CasmContractClass, ContractClass as SierraContractClass,
994995
};
995996
use std::{fs, path::Path, sync::Arc};

examples/lru_cache/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use starknet_in_rust::{
1212
contract_class_cache::{ContractClassCache, PermanentContractClassCache},
1313
in_memory_state_reader::InMemoryStateReader,
1414
},
15-
transaction::{Address, Declare, Deploy, InvokeFunction},
16-
utils::{calculate_sn_keccak, ClassHash},
15+
transaction::{Address, ClassHash, Declare, Deploy, InvokeFunction},
16+
utils::calculate_sn_keccak,
1717
};
1818
use std::{
1919
num::NonZeroUsize,

fuzzer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate honggfuzz;
55

66
use cairo_vm::{vm::runners::cairo_runner::ExecutionResources, Felt252};
77
use starknet_in_rust::execution::execution_entry_point::ExecutionResult;
8-
use starknet_in_rust::utils::ClassHash;
8+
use starknet_in_rust::transaction::ClassHash;
99
use starknet_in_rust::EntryPointType;
1010
use starknet_in_rust::{
1111
definitions::{block_context::BlockContext, constants::TRANSACTION_VERSION},

rpc_state_reader/src/sir_state_reader.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ use starknet_in_rust::{
2828
BlockInfo,
2929
},
3030
transaction::{
31-
declare_tx_from_sn_api_transaction, error::TransactionError, Address, DeployAccount,
32-
InvokeFunction, L1Handler,
31+
declare_tx_from_sn_api_transaction, error::TransactionError, Address, ClassHash,
32+
DeployAccount, InvokeFunction, L1Handler,
3333
},
34-
utils::ClassHash,
3534
};
3635

3736
use crate::{

src/bin/fibonacci.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use cairo_vm::Felt252;
22
use lazy_static::lazy_static;
33

4-
use starknet_in_rust::utils::ClassHash;
4+
use starknet_in_rust::transaction::ClassHash;
55
use starknet_in_rust::{
66
definitions::{block_context::BlockContext, constants::TRANSACTION_VERSION},
77
execution::{

src/bin/invoke.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use starknet_in_rust::{
1010
cached_state::CachedState, contract_class_cache::PermanentContractClassCache,
1111
in_memory_state_reader::InMemoryStateReader,
1212
},
13-
transaction::{Address, InvokeFunction, Transaction},
14-
utils::ClassHash,
13+
transaction::{Address, ClassHash, InvokeFunction, Transaction},
1514
};
1615
use std::{path::PathBuf, sync::Arc};
1716

src/bin/invoke_with_cachedstate.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ use starknet_in_rust::{
99
services::api::contract_classes::{
1010
compiled_class::CompiledClass, deprecated_contract_class::ContractClass,
1111
},
12-
state::in_memory_state_reader::InMemoryStateReader,
1312
state::{
14-
cached_state::CachedState, contract_class_cache::PermanentContractClassCache, BlockInfo,
13+
cached_state::CachedState, contract_class_cache::PermanentContractClassCache,
14+
in_memory_state_reader::InMemoryStateReader, BlockInfo,
1515
},
16-
transaction::Address,
17-
transaction::{InvokeFunction, VersionSpecificAccountTxFields},
18-
utils::ClassHash,
16+
transaction::{Address, ClassHash, InvokeFunction, VersionSpecificAccountTxFields},
1917
};
2018
use std::{collections::HashMap, path::PathBuf, sync::Arc};
2119

src/bin/native_bench.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ use starknet_in_rust::{
3232
},
3333
state::cached_state::CachedState,
3434
state::{in_memory_state_reader::InMemoryStateReader, ExecutionResourcesManager},
35-
transaction::Address,
36-
utils::ClassHash,
35+
transaction::{Address, ClassHash},
3736
};
3837
use std::cell::RefCell;
3938
use std::rc::Rc;

src/core/errors/state_errors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::{
2-
services::api::contract_class_errors::ContractClassError, state::state_cache::StorageEntry,
3-
transaction::Address, utils::ClassHash,
2+
services::api::contract_class_errors::ContractClassError,
3+
state::state_cache::StorageEntry,
4+
transaction::{Address, ClassHash},
45
};
56
use starknet::core::types::FromByteArrayError;
67
use thiserror::Error;

0 commit comments

Comments
 (0)