Skip to content

[Feature]: Allow setting contract::address in unit tests #5

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

Closed
1 task done
0xNeshi opened this issue Dec 13, 2024 · 1 comment · Fixed by #14
Closed
1 task done

[Feature]: Allow setting contract::address in unit tests #5

0xNeshi opened this issue Dec 13, 2024 · 1 comment · Fixed by #14

Comments

@0xNeshi
Copy link
Collaborator

0xNeshi commented Dec 13, 2024

What is the feature you would like to see?

Could be helpful in such contracts testing such as VestingWallet and Erc20FlashMint.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
@0xNeshi
Copy link
Collaborator Author

0xNeshi commented Dec 13, 2024

Depends on OpenZeppelin/rust-contracts-stylus#423

@ggonzalez94 ggonzalez94 transferred this issue from OpenZeppelin/rust-contracts-stylus Dec 17, 2024
bidzyyys added a commit to OpenZeppelin/rust-contracts-stylus that referenced this issue Jan 7, 2025
<!--
Thank you for your interest in contributing to OpenZeppelin!

Consider opening an issue for discussion prior to submitting a PR. New
features will be merged faster if they were first discussed and designed
with the team.

Describe the changes introduced in this pull request. Include any
context necessary for understanding the PR's purpose.
-->

**NOTE: It is impossible to write any unit tests until it is possible to
mock `contract::address()` in tests (see
OpenZeppelin/stylus-test-helpers#5

<!-- Fill in with issue number -->
Resolves #355

#### PR Checklist

<!--
Before merging the pull request all of the following must be completed.
Feel free to submit a PR or Draft PR even if some items are pending.
Some of the items may not apply.
-->

- [x] Tests
- [x] Documentation
- [x] Changelog

---------

Co-authored-by: Nenad <[email protected]>
Co-authored-by: Nenad <[email protected]>
Co-authored-by: Daniel Bigos <[email protected]>
Co-authored-by: Alisander Qoshqosh <[email protected]>
@github-project-automation github-project-automation bot moved this from Todo to Done in Rust Contracts Stylus Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants