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

fix: account version serialization tests #12871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stedfn
Copy link
Contributor

@stedfn stedfn commented Feb 4, 2025

No description provided.

@stedfn stedfn requested a review from pugachAG February 4, 2025 20:12
@stedfn stedfn marked this pull request as ready for review February 4, 2025 20:12
@stedfn stedfn requested a review from a team as a code owner February 4, 2025 20:12
amount: 1_000_000,
locked: 1_000_000,
code_hash: CryptoHash::hash_bytes(&[42]),
storage_usage: 100,
};
let old_account = Account::V1(account_v1.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

old account is expected to be just AccountV1 (not wrapped in enum) since that is the old representation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the issue with that is that the serde / borsh traits are implemented for the Account enum. Should I also implement them for AccountV1?

Copy link
Contributor

Choose a reason for hiding this comment

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

what is the exact problem you trying to solve here?

Copy link
Contributor Author

@stedfn stedfn Feb 5, 2025

Choose a reason for hiding this comment

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

Trying to introduce the AccountContractType enum here but the serde v1 test fails if it is not wrapped in Account

Copy link
Contributor

Choose a reason for hiding this comment

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

you are not allowed to remove fields from SerdeAccount that breaks backward compatibility

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.

2 participants