saber-hq / anchor-gen

Generates an Anchor CPI crate from a JSON IDL.
https://crates.io/crates/anchor-gen
Apache License 2.0
106 stars 58 forks source link

Suppress automatic generation of Default trait for array whose length is over 32 #5

Closed everlastingsong closed 2 years ago

everlastingsong commented 2 years ago

Do not add derive(Default) to structures containing arrays longer than 32 because derive(Default) generates code that cannot be compiled.

This IDL contains TickArray account which has ticks field which is an array of size 88. https://github.com/orca-so/whirlpools/blob/main/sdk/src/artifacts/whirlpool.json

macalinao commented 2 years ago

Very nice. I'll add this to the docs