-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Milestone
Description
Sometimes, contract methods will need to pre-allocate funds to cover rent exemption for a given type and there's not currently a method to return the expect size of a given type without first having an instance of that type.
This feature is to extend the account type trait to include a size_hint() method that returns the byte size for the given type, assuming a default value for types that include variable-size fields (32 bytes for a list of pubkeys indicating a vec of a single pubkey as the default).
This should be a static method attached to the trait and for types that are statically sized their existing size() method can just call the size_hint() method.
Reactions are currently unavailable