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: prevent zero address for author/voter #492

Merged
merged 13 commits into from
Aug 23, 2023

Conversation

Orland0x
Copy link
Contributor

closes #488

Copy link
Contributor

@pscott pscott left a comment

Choose a reason for hiding this comment

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

sorry I forgot to click "submit review" yesterday :(


// Create Proposal
authenticator.authenticate(space.contract_address, PROPOSE_SELECTOR, propose_calldata);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Erm I know you wrote a lot of the code but I would suggest to do these tests:

write a test module that only does a unit test on is_zero (could actually be inside of user_address.cairo tbh but doesn't have to).
In this unit test we try starknet, ethereum, and custom).

And then we actually test the three entrypoints (to get full code coverage and regression test), on cancel, propose, update_proposal, and vote. This time we don't care about whether they're starknet or ethereum, we just check to see if the code is here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep got the unit tests and all entry points tested. sorry was being a bit lazy

Copy link
Contributor

Choose a reason for hiding this comment

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

nice, perfect

starknet/src/space/space.cairo Show resolved Hide resolved
@Orland0x Orland0x requested a review from pscott August 18, 2023 20:42
Copy link
Contributor

@pscott pscott left a comment

Choose a reason for hiding this comment

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

utACK, added some false positive tests

@Orland0x Orland0x merged commit 6f02445 into develop Aug 23, 2023
2 checks passed
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.

Check 0 address in space contract
2 participants