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

Remove StateClone #1041

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Remove StateClone #1041

merged 1 commit into from
Jul 15, 2024

Conversation

DOBEN
Copy link
Member

@DOBEN DOBEN commented Jul 10, 2024

Purpose

closes #1039

Changes

  • Remove StateClone

Copy link
Contributor

@Victor-N-Suadicani Victor-N-Suadicani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So as far as I gather, this was only used during unit tests? Ideally it should have been derived with cfg_attr(test, ...) (or does the derive macro do that?) but removing it is fine if it was only ever used this way I guess.

@DOBEN
Copy link
Member Author

DOBEN commented Jul 15, 2024

So as far as I gather, this was only used during unit tests? Ideally it should have been derived with cfg_attr(test, ...) (or does the derive macro do that?) but removing it is fine if it was only ever used this way I guess.

We used to have different macros (such as StateClone) that allowed the use of the contract state in the real blockchain environment as well as in a mocked-up environment (using the cargo unit test infrastructure). These abstractions were quite cumbersome and it was hard to mock all smart contract interactions realistically hence we built the integration testing library framework that is used nowadays.

Since the unit testing infrastructure has been deprecated for a while now, I do not fully remember all its details, so it is hard to discuss whether it should have been implemented otherwise or not. But I would expect that if we compile the smart contract for the actual deployment on-chain unnecessary testing abstractions/code would be removed in the past.

@DOBEN DOBEN merged commit 5c80822 into main Jul 15, 2024
2 checks passed
@DOBEN DOBEN deleted the remove-stateClone branch July 15, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove StateClone trait from the documentation
2 participants