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

Legacy contract class corrupted when deserialized through ContractArtifact #392

Open
xJonathanLEI opened this issue Jun 1, 2023 · 2 comments

Comments

@xJonathanLEI
Copy link
Owner

Due to a scientific notation issue, certain legacy (Cairo 0) contract artifacts can be different when deserializing directly and through the ConrtractArtifact enum. This leads to class hash errors, and hence failures on contract declaration.

Details to be updated later. Creating this issue first so that it can be referenced from starkli.

@xJonathanLEI
Copy link
Owner Author

Looks like the switch to raw_value in c5cf196 has made this worse. Previously only artifacts with values that can be converted to the scientific notation without precision loss are affected; now it looks like most artifacts are affected.

xJonathanLEI added a commit that referenced this issue Jul 29, 2024
Adds test cases that asserts contract artifacts are
not corrupted whether deserialized directly or via the
`ContractArtifact` enum. The test for `LegacyContractClass` -
`test_legacy_artifact_deser_from_contract_artifact` - is ignored due to
a known issue #392.
@xJonathanLEI
Copy link
Owner Author

Added a test case (that's disabled by default to avoid breaking CI) in #644, test_legacy_artifact_deser_from_contract_artifact, specifically to test this issue. A patch to this issue should be able to also remove the ignore attribute on that test case.

xJonathanLEI added a commit that referenced this issue Jul 29, 2024
Adds test cases that asserts contract artifacts are
not corrupted whether deserialized directly or via the
`ContractArtifact` enum. The test for `LegacyContractClass` -
`test_legacy_artifact_deser_from_contract_artifact` - is ignored due to
a known issue #392.
xJonathanLEI added a commit that referenced this issue Jul 29, 2024
Adds test cases that asserts contract artifacts are
not corrupted whether deserialized directly or via the
`ContractArtifact` enum. The test for `LegacyContractClass` -
`test_legacy_artifact_deser_from_contract_artifact` - is ignored due to
a known issue #392.
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

No branches or pull requests

1 participant