-
Notifications
You must be signed in to change notification settings - Fork 37
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
Migrate tests for example contracts #347
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also sets a default type for the StateBuilder to be (Extern)`StateApi` so that users don't have to specify a parameter unless they also use the testing-infrastructure.
- Migrates the tests from the deprecated testing infrastructure to `concordium-smart-contract-testing`. - Remove the abstractions/generics in the init and receive methods that were only needed to support the old testing infrastructure - Make a few minor changes to the examples to enable testing, for example adding a contract to be called in the counter-notify example.
Also removes the generics needed for the old testing library.
The contracts no longer have the crypto-primitives feature as it is not needed.
DOBEN
approved these changes
Oct 10, 2023
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.
Very good to see how much this improves the contract's readability once we remove these generics (not needed anymore because the old unit testing will be deprecated soon). Nice work.
Also documents how to migrate your smart contract to use the concrete types.
Bargsteen
commented
Oct 12, 2023
Bargsteen
commented
Oct 12, 2023
Bargsteen
commented
Oct 12, 2023
Co-authored-by: Doris Benda <[email protected]>
limemloh
approved these changes
Oct 12, 2023
5 tasks
* Deprecate several traits in favour of the concrete alternatives Also documents how to migrate your smart contract to use the concrete types. * Deprecate `test_infrastructure` module and update changelog * Add backlinks * Clarify documentation * Explain allow deprecated * Address review comments
64dbe2f
to
f9e835b
Compare
b36c6d0
to
ee531fd
Compare
This was referenced Oct 19, 2023
abizjak
added a commit
that referenced
this pull request
Oct 27, 2023
Migrate tests for example contracts
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Migrate the tests of most of our example contracts from the old testing infrastructure to the new integration testing library.
Closes #337 and #338.
Changes
PartialEq
/Eq
for some cis2 typesExtern*
types, e.g.type StateApi = ExternStateApi
ContractInvokeSuccess::events
transfer-policy-check
cargo concordium test --out
./concordium-out/module.wasm.v1in the CI instead of
cargo test`test_infrastructure
and supporting traits #349Checklist
hard-to-understand areas.