-
Notifications
You must be signed in to change notification settings - Fork 240
Create ContractsDataStore only once
#3856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: add-gas-report-logic
Are you sure you want to change the base?
Conversation
|
This change is part of the following stack:
Change managed by git-spice. |
| pub fn build_debugging_trace( | ||
| call_trace: &CallTrace, | ||
| contracts_data: &ContractsData, | ||
| contracts_data_store: &ContractsDataStore, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer this takes by value instead of cloning internally. For a larger structure like this, I think it's better to have clone calls clearly visible at caller site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove cloning altogether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the whole change is to not have to recreate the struct here, right?
| pub fn build_debugging_trace( | ||
| call_trace: &CallTrace, | ||
| contracts_data: &ContractsData, | ||
| contracts_data_store: &ContractsDataStore, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove cloning altogether
1c1e984 to
b5ef498
Compare
|
|
||
| /// Data structure containing information about contracts, | ||
| /// including their ABI, names, selectors and programs that will be used to create a [`Trace`](crate::Trace). | ||
| #[derive(Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for derive now
| #[derive(Clone)] |
[Refactor only]