-
Notifications
You must be signed in to change notification settings - Fork 356
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
Create a testing contract for easier "full stack" testing #1403
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.
Good stuff.
I think we need a better name. Having a tests contract in a test as part of the tests is not super helpful. I don't have great ideas. We can go for any fantasy name or just "stateless" or "pure".
contracts/tests/src/contract.rs
Outdated
} | ||
} | ||
|
||
fn do_argon2(mem_cost: u32, time_cost: u32) -> Result<Response, HackError> { |
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.
Renaming this to fn execute_argon2
would be more consistent with the fn query_*
style we usually use for queries.
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.
Oh yeah, when working on Isotonic we got into the habit of creating submodules like
mod query {
fn balance(...) -> ... {}
// ...
}
mod execute {
fn mint(...) -> ... {}
// ...
}
I'd kind of want to do that, but I also understand it wouldn't be consistent with the style of other contracts in the repo.
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.
Sounds great. Let's do that for all new contracts.
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.
is fn execute
and mod execute
in the same module not a problem?
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.
It isn't. I think those are separate namespaces
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
...would |
Absolutely |
Closes #1401