Skip to content

Conversation

@ddoktorski
Copy link
Contributor

Towards #3660

@ddoktorski ddoktorski requested a review from a team as a code owner October 28, 2025 12:53
@ddoktorski ddoktorski requested review from MKowalski8 and franciszekjob and removed request for a team October 28, 2025 12:53
@ddoktorski ddoktorski requested a review from cptartur October 28, 2025 12:54

#[derive(Debug, Clone, PartialOrd, PartialEq, Ord, Eq)]
pub enum ContractId {
TestContract(ContractName),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: wdyt?

Suggested change
TestContract(ContractName),
LocalContract(ContractName),

Copy link
Member

Choose a reason for hiding this comment

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

I prefer local


#[derive(Debug, Clone, PartialOrd, PartialEq, Ord, Eq)]
pub enum ContractId {
TestContract(ContractName),
Copy link
Member

Choose a reason for hiding this comment

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

I prefer local

Comment on lines +126 to +132
let name = match self {
ContractId::TestContract(name) => format!("{name} Contract"),
ContractId::ForkedContract(class_hash) => {
format!(
"forked contract\n(class hash: {})",
shorten_felt(class_hash.0)
)
Copy link
Member

Choose a reason for hiding this comment

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

Capitalization is inconsistent between these

ContractId::ForkedContract(class_hash) => {
format!(
"forked contract\n(class hash: {})",
shorten_felt(class_hash.0)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it should be configurable to show full contract urls, maybe let's just add an issue for that, maybe it can be integrated if we ever add a -v flag to foundry.

Comment on lines +3 to +8
pub(super) fn shorten_felt(felt: Felt) -> String {
let padded = format!("{felt:#066x}");
let first = &padded[..4];
let last = &padded[padded.len() - 4..];
format!("{first}…{last}")
}
Copy link
Member

Choose a reason for hiding this comment

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

The first 3 characters area always 0x0, maybe we should also show 4 after that? It's not very useful to show that beginning otherwise.

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