metaplex-foundation / solita

Genrates an SDK API from solana contract IDL.
Apache License 2.0
140 stars 32 forks source link

Enum not using integer value #110

Open SC4RECOIN opened 9 months ago

SC4RECOIN commented 9 months ago
pub enum UpdateConfigMode {
    UpdateLoanToValuePct = 1,
    UpdateMaxLiquidationBonusBps = 2,
    UpdateLiquidationThresholdPct = 3,
}

gets converted to

export enum UpdateConfigMode {
  UpdateLoanToValuePct,
  UpdateMaxLiquidationBonusBps,
  UpdateLiquidationThresholdPct,
}

which is 0 based

this can be fixed by updating the rust enum to start from 0 or solita can be updated to generate the appropriate enum values

export enum UpdateConfigMode {
  UpdateLoanToValuePct = 1,
  UpdateMaxLiquidationBonusBps,
  UpdateLiquidationThresholdPct,
}

this is minor so feel free to close if not a priority