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

[feat] Add asserts to set_name #260

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

jsanchez556
Copy link
Contributor

Pull Request

  • Closes #
  • [ X] Added tests (if necessary)
  • [ X] Run tests
  • Run formatting
  • Commented the code

Changes description

  1. Locate the set_name function in contracts/src/fund.cairo and enhance it by adding validation to ensure the caller is either VALID_ADDRESS_1 or VALID_ADDRESS_2.
  2. Add a test to verify that the set_name function works correctly when called by VALID_ADDRESS_1 or VALID_ADDRESS_2.
  3. Add a test to confirm that the set_name function does not work when called by an address other than VALID_ADDRESS_1 or VALID_ADDRESS_2.

Current output

Screenshot from 2024-11-22 10-54-04

Time spent breakdown

2 hours.

Comments

Thank you for the opportunity to contribute to this great project

contracts/src/fund.cairo Show resolved Hide resolved
}

#[test]
#[should_panic(expected: ("You are not the admin",))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add test when the owner call, keep the assert, i left u a comment
Keep test_set_name_not_admin test is ok

@EmmanuelAR
Copy link
Collaborator

Great work @jsanchez556! just some changes request it!

@adrianvrj adrianvrj linked an issue Nov 22, 2024 that may be closed by this pull request
Copy link
Collaborator

@EmmanuelAR EmmanuelAR left a comment

Choose a reason for hiding this comment

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

LGTM, great work g!

@EmmanuelAR EmmanuelAR merged commit 0bac2a6 into web3wagers:dev Nov 23, 2024
5 checks passed
@jsanchez556
Copy link
Contributor Author

@all-contributors please add @jsanchez556 for code

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.

[feat] Add new asserts to set_name
2 participants