-
Notifications
You must be signed in to change notification settings - Fork 36
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
Contract state is no longer required to implement StateClone
for unit testing
#321
Conversation
…Clone` trait is deprecated since crate version 8.0
One thing which I didn't touch is whether |
Hi. thanks for the effort. We were planning to deprecate the entire test infrastructure as it is now in favor of the testing library and with that we would remove in particular the StateClone, but also the odd and hard to explain "state_parameter = S" annotation on the macros, and a few generics on entrypoints. I would prefer to do that in one big release, rather than deprecating/removing things one at a time. Is this blocking you? If it is, I don't think deprecating is the right approach. People should not be writing these by hand anyhow, so we should just remove the StateClone trait entirely. |
Well, this test infra is kind of useful in some scenarios 'cause it allows debugging contract directly. Nope, it's not blocking me or anything. Just had some spare time and inspiration to drop it. Thought that soft deprecation is better, as it won't break other users' code. Shall I remove |
Sure, but the issue is that it adds a lot of complexity, both in terms of the way the contracts look (with extra generics), and with the amount of code we need to maintain (for example the entire implementation of test infrastructure, including its own state implementation). So our conclusion is that iti s not worth it.
Yes, that'd be my preference. |
I dropped |
3627aa5
to
0cb2d5f
Compare
…plates, such that crates from working copy are used
0cb2d5f
to
c300239
Compare
Ok, so |
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 good.
Sorry for the tardiness here as well. This will be released on Monday.
I have merged it into #330
Purpose
Remove
StateClone
trait, which was needed only to clone toplevel contract state during unit testingChanges
TestHost
implementation no longer imposesStateClone
constraint onto state typeStateClone
is removed (see comment)Checklist
hard-to-understand areas.
CLA acceptance
By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0
link: https://developers.concordium.com/CLAs/Contributor-License-Agreement-v1.0.pdf
I accept the above linked CLA.