metaplex-foundation / shank

Extracts IDL from Solana Rust contracts
https://docs.rs/crate/shank_macro/latest
130 stars 26 forks source link

feat: acccount padding support #25

Closed thlorenz closed 2 years ago

thlorenz commented 2 years ago

Summary

Adds support to declare an account field as padding.

#[derive(ShankAccount)]
pub struct StructAccountWithPadding {
    count: u8,
    #[padding]
    _padding: [u8; 3],
}

This attribute is included in the Account IDL attrs as "padding".

Details

This required changes to:

Related Work

Solita is updated in this PR to adapt the rendered code for Accounts with padding.

Fixes: #17