File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
forge-runner/src/debugging Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use starknet_api::execution_utils::format_panic_data;
1515
1616pub struct Collector < ' a > {
1717 call_trace : & ' a CallTrace ,
18- context : & ' a Context ,
18+ context : & ' a Context < ' a > ,
1919}
2020
2121impl < ' a > Collector < ' a > {
Original file line number Diff line number Diff line change @@ -2,15 +2,18 @@ use crate::Components;
22use crate :: contracts_data_store:: ContractsDataStore ;
33
44/// Context is a structure that holds the necessary data for creating a [`Trace`](crate::Trace).
5- pub struct Context {
6- contracts_data_store : ContractsDataStore ,
5+ pub struct Context < ' a > {
6+ contracts_data_store : & ' a ContractsDataStore ,
77 components : Components ,
88}
99
10- impl Context {
11- /// Creates a new instance of [`Context`] from a given `cheatnet` [`ContractsData`], [`ForkData `] and [`Components`].
10+ impl < ' a > Context < ' a > {
11+ /// Creates a new instance of [`Context`] from a given [`ContractsDataStore `] and [`Components`].
1212 #[ must_use]
13- pub fn new ( contracts_data_store : ContractsDataStore , components : Components ) -> Self {
13+ pub fn new (
14+ contracts_data_store : & ' a ContractsDataStore ,
15+ components : Components ,
16+ ) -> Context < ' a > {
1417 Self {
1518 contracts_data_store,
1619 components,
@@ -20,7 +23,7 @@ impl Context {
2023 /// Returns a reference to the [`ContractsDataStore`].
2124 #[ must_use]
2225 pub fn contracts_data_store ( & self ) -> & ContractsDataStore {
23- & self . contracts_data_store
26+ self . contracts_data_store
2427 }
2528
2629 /// Returns a reference to the [`Components`].
Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ pub fn build_debugging_trace(
1616 test_name : String ,
1717) -> Option < debugging:: Trace > {
1818 let components = trace_args. to_components ( ) ?;
19- let context = debugging:: Context :: new ( contracts_data_store. clone ( ) , components) ;
19+ let context = debugging:: Context :: new ( contracts_data_store, components) ;
2020 Some ( debugging:: Trace :: new ( call_trace, & context, test_name) )
2121}
You can’t perform that action at this time.
0 commit comments