-
Notifications
You must be signed in to change notification settings - Fork 81
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
TESTCOV: Sputnik Factory: Ownership #146
TESTCOV: Sputnik Factory: Ownership #146
Conversation
We are not compleatly sure that solution for [owner_can_be_a_dao_account] is correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments below, thanks!
Changed as required @TrevorJTClarke thanks a lot for the clarification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like almost complete! Just need to change 1 test - see comment
sputnikdao-factory2/src/lib.rs
Outdated
|
||
factory.create(bob(), "{}".as_bytes().to_vec().into()); | ||
|
||
factory.set_owner(alice()); | ||
|
||
assert_eq!(factory.get_owner(), alice()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is wrong - it needs to use the DAO account in the set_owner
method, then check that the DAO account is owner in get_owner
.
Since you're using bob as the name, it will be something like bob.sputnik-dao.near
as the DAO account.
So make sure to change set_owner
to be the actual full dao name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes, logic should be correct now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, all fixed - thanks!
…m/nninkovicSQA/sputnik-dao-contract into TESTCOV-Sputnik-Factory-Ownership
Draft PR for Sputnik Factory Ownership test coverage #121
Tests will be written in Rust in a test module inside a respected file (lib.rs).
Recommendations are very welcome.