Skip to content

[PR #28] LiquidationParams enum missing #[non_exhaustive] — semver-breaking on variant add #73

@obchain

Description

@obchain

PR: #28 (feat/03-lending-protocol-trait)
File: crates/charon-core/src/types.rs, lines 69-79

LiquidationParams has one variant (Venus) today. Rustdoc on the enum explicitly names future protocols (Aave, Compound). Without #[non_exhaustive], any exhaustive match in downstream workspace crate fails to compile on variant add, forcing coordinated multi-crate change.

Same finding applies to the single Venus struct variant — mark #[non_exhaustive] at variant level so new fields (e.g., comptroller_address) do not break public matches.

Fix:

#[non_exhaustive]
pub enum LiquidationParams {
    #[non_exhaustive]
    Venus {
        borrower: Address,
        collateral_vtoken: Address,
        debt_vtoken: Address,
        repay_amount: U256,
    },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polish

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions