Skip to content
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

Delete testing infrastructure, supporting traits and types, and simplify names of types #341

Open
5 tasks
Bargsteen opened this issue Sep 18, 2023 · 1 comment
Labels
[Type] Task An additional feature or improvement.

Comments

@Bargsteen
Copy link
Contributor

Bargsteen commented Sep 18, 2023

Task description

We are in the process of deprecating the old testing infrastructure, as described in #335, and related issues.

The testing infrastructure will remain in place for now, but it will eventually be removed. There is no current timeline for this.

This issue describes the preliminary ideas about what will happen at that point.

  • Delete the traits that only exist to allow your contracts to use the testing infrastructure
    • For example HasHost, which has two concrete implementations ExternHost and TestHost.
  • Delete the testing infrastructure code, including the types, fx. TestHost
  • Remove the Extern* prefixes, fx for ExternHost and ExternReturnValue etc.
    • The prefix no longer has any value as corresponding Test* types are removed.
    • The names will then conflict with the type aliases we created, which should be removed. For example type Host = ExternHost.
  • Remove the mentioning of the test infrastructure in the code documentation.
  • Remove the state_parameter attribute, see the comment below.
@Bargsteen Bargsteen added the [Type] Task An additional feature or improvement. label Sep 18, 2023
@Bargsteen
Copy link
Contributor Author

Bargsteen commented Apr 29, 2024

We still have two example contracts that use the old testing library because they use quickcheck (as described in #347).
Ideally, we should integrate quickcheck in the integration testing library, rewrite the tests for those two contracts, and then completely remove the old testing infrastructure.
Alternatively, we can also drop the support for quickcheck for now and remove the tests that use it. Which allows us to remove the old testing infrastructure now.

From my point of view, the primary pain points with current types is the added complexity once you dive into the types because we have the abstraction from traits, and because the abstraction shines through when using state* types in your state, e.g.:

#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S = StateApi> {
    addresses: StateSet<AccountAddress, S>,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Task An additional feature or improvement.
Projects
None yet
Development

No branches or pull requests

1 participant