Skip to content

Conversation

@grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Oct 10, 2025

Motivation

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

if *has_ret {
// try this.addressToCounter1() returns (Counter c)
try_catch_helpers.insert(name);
(format!("this.addressTo{name}{id}(", id = contract_id.get()), "}))")
Copy link
Member

Choose a reason for hiding this comment

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

should ID be dep.referenced_contract?

Copy link
Collaborator Author

@grandizzy grandizzy Oct 11, 2025

Choose a reason for hiding this comment

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

I added the id of the preprocessed contract (test contract) to avoid issues when test inherits another test, for example if CounterTestA is CounterTestB and they both have the addressToCounter function. Adding test contract id will make them unique and avoid collisions

@DaniPopes
Copy link
Member

rest lgtm

@grandizzy grandizzy merged commit f085357 into foundry-rs:master Oct 11, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Oct 11, 2025
@grandizzy grandizzy deleted the preproc-try-catch-custom-return branch October 11, 2025 07:37
@grandizzy grandizzy self-assigned this Oct 13, 2025
@jenpaff jenpaff moved this from Done to Completed in Foundry Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants