Skip to content

Conversation

@ddoktorski
Copy link
Contributor

Towards #3660

@ddoktorski ddoktorski requested a review from a team as a code owner October 21, 2025 11:52
@ddoktorski ddoktorski requested review from MKowalski8 and franciszekjob and removed request for a team October 21, 2025 11:52
@ddoktorski ddoktorski marked this pull request as draft October 21, 2025 11:52
@ddoktorski ddoktorski force-pushed the add-gas-report-logic branch 2 times, most recently from 8a9f925 to 8f3b1f6 Compare October 22, 2025 18:37
@ddoktorski ddoktorski changed the base branch from add-gas-report-logic to share-contracts-data-store October 22, 2025 18:58
@ddoktorski ddoktorski force-pushed the 3660-gas-report branch 2 times, most recently from 8517806 to 73d507a Compare October 23, 2025 12:32
if !contract_info.functions.is_empty() {
let table = format_table_output(contract_info, name);
writeln!(f, "\n{table}")?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case can there be contract without functions? In case it wasn't actually called in tests or some other ones as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this shouldn't really happen. It's just an extra cautious step to make sure we don't display an empty table

Comment on lines 3 to 4
use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::{Cell, Color, Table};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad someone already made a lib for that and we don't have to deal with printing tables

Cell::new(report_data.gas_stats.min.to_string()).fg(Color::Green),
Cell::new(report_data.gas_stats.max.to_string()).fg(Color::Red),
Cell::new(report_data.gas_stats.mean.round().to_string()).fg(Color::Yellow),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this coloring. I'd rather eventually have some colors based on values or something. Maybe let's just have them all single color or even just white?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Contributor

@franciszekjob franciszekjob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case when no functions are invoked, we don't display the table. Maybe we should inform a user by displaying info/warning message?

@ddoktorski ddoktorski force-pushed the share-contracts-data-store branch from 1c1e984 to b5ef498 Compare October 24, 2025 12:01
@ddoktorski ddoktorski force-pushed the share-contracts-data-store branch from b5ef498 to 6bd6031 Compare October 28, 2025 09:58
@ddoktorski ddoktorski marked this pull request as ready for review October 28, 2025 10:30
@ddoktorski
Copy link
Contributor Author

In case when no functions are invoked, we don't display the table. Maybe we should inform a user by displaying info/warning message?

We could add a note stating that a gas report hasn't been produced because there were no contract calls, but I'm not sure if that's necessary. Any thoughts @cptartur?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants