-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added tests for smart contract #22
Conversation
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.
Small code readability stuff
tests/rust_tests.rs
Outdated
.execute_query(&setup.contract_wrapper, |sc| { | ||
sc.require_value_is_positive(&managed_biguint!(0u64)); | ||
}) | ||
.assert_error(4, "Value must be positive"); |
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.
Error returned by that function should be changed to "Value must be higher than or equal to zero" if it accepts 0, too. Value must be positive can be misleading
} | ||
|
||
#[test] //Tests the whitelist functionality | ||
fn white_list_test() { |
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.
Name is too similar to the other whitelist_test
tests/rust_tests.rs
Outdated
@@ -127,6 +137,43 @@ fn pause_test() { | |||
.assert_ok(); | |||
} | |||
|
|||
#[test] // Tests if the contract has whitelist enabled and is empty |
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.
Should change comment to "Tests if the contract has whitelist enabled and is empty by default after deployment"
tests/rust_tests.rs
Outdated
@@ -127,6 +137,43 @@ fn pause_test() { | |||
.assert_ok(); | |||
} | |||
|
|||
#[test] // Tests if the contract has whitelist enabled and is empty | |||
// Tests if the royalties and supply are set accordingly | |||
fn whitelist_test() { |
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.
Why is the test named whitelist_test if it also tests royalties?
tests/rust_tests.rs
Outdated
} | ||
|
||
#[test] // Tests burn functionality | ||
fn burn_token_tests() { |
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 method is named "tests" while the others are named "test". Small detail, but generally we should try following a pattern
No description provided.