Skip to content
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

tests: use relative path in utils contracts #1169

Merged
merged 6 commits into from
Feb 5, 2025
Merged

Conversation

smol-ninja
Copy link
Member

Closes #1168

Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

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

didn't we decide to publish 2.0.1? why no version bump in package.json file, and no CHANGELOG update?

also, i was looking at the DeployOptimized utils test contract, this file assumes there is a out-optimized profile under foundry configuration. which might be very unlikely, thus, should we mark it as .t.sol instead?

@smol-ninja
Copy link
Member Author

smol-ninja commented Feb 5, 2025

didn't we decide to publish 2.0.1? why no version bump in package.json file, and no CHANGELOG update?

Will do. I missed it.

DeployOptimized utils test contract, this file assumes there is a out-optimized profile under foundry configuration

Its not looking for the profile, but for the out-optimized directory, which we are already publishing under the artifacts name. Loading from artifacts will be complicated though so happy to rename it to .t.sol.

But, instead of renaming it to DeployOptimized.t.sol, what if I add it to .npmignore? Base imports from DeployOptimized.t.sol and importing from a .t.sol file looks weird.

@andreivladbrg
Copy link
Member

Its not looking for the profile, but for the out-optimized directory, which we are already publishing under the artifacts name. Loading from artifacts will be complicated though so happy to rename it to .t.sol.

it is not specifically for the profile, but in order to have an out-optimized directory, we need that profile. otherwise, if we simply run forge build, foundry would create only the out directory (test it with bun run clean && forge b).

i’m not saying to extract it from artifacts, i’m just saying it’s very unlikely for someone to have this profile (which would generate the above directory) and actually use this file (similarly to Precompiles). thus simply rename it to .t.sol (which is already ignored in .npmignore)

importing from a .t.sol file looks weird.

why? :)) all the other files that are not under utils use this format, and they don’t look weird. (e.g. Base.t.sol)

@smol-ninja
Copy link
Member Author

made all the changes. LMK if it looks good now.

andreivladbrg
andreivladbrg previously approved these changes Feb 5, 2025
Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

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

👍

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Andrei Vlad Birgaoanu <[email protected]>
@smol-ninja smol-ninja merged commit baf9a9e into main Feb 5, 2025
8 checks passed
@smol-ninja smol-ninja deleted the fix/imports-utils branch February 5, 2025 13:32
smol-ninja added a commit that referenced this pull request Feb 5, 2025
* tests: use relative path in Utility contracts

* docs: update changelog and bump npm version

* test: use 2.0.1 in BaseScript.t.sol

* test: rename DeployOptimized.sol to DeployOptimized.t.sol

* docs: update changelog

* docs: update changelog

Co-authored-by: Andrei Vlad Birgaoanu <[email protected]>

---------

Co-authored-by: Andrei Vlad Birgaoanu <[email protected]>
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.

Imports source contracts using relative path in Modifiers and BatchLockupBuilder
2 participants