Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Conversation

@febo
Copy link
Owner

@febo febo commented Nov 28, 2024

Problem

There are currently two issues on how account types are loaded:

  1. The from_bytes method does not validate whether the byte slice has the expected size.
  2. There is no option to validate whether the account type is initialized or not. This leads to duplicating the validation code across processors.

Solution

Improve the logic to load accounts by using a set of traits:

  • RawType: marker trait for "raw" types.
  • Initializable: types that can be initialized.

Additionally, a set of load_* helpers facilitate loading account data using these traits.

@febo febo merged commit a6b53b6 into main Nov 28, 2024
4 checks passed
@febo febo deleted the febo/raw-type branch November 28, 2024 22:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants