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

add compat-program-result feature #10

Closed everlastingsong closed 1 year ago

everlastingsong commented 1 year ago

To use anchor-gen with anchor v0.20.x and v0.21.0, the return type of instruction must be ProgramResult (not Result<()>) The type changed at v0.22.0 as breaking change. https://github.com/coral-xyz/anchor/blob/master/CHANGELOG.md#breaking-3

compat-program-result feature changes return type of instruction to ProgramResult.