The Rust renderer flattens composite account groups into a single struct without handling duplicate account names, resulting in compilation errors.
{
"name": "withdraw",
"accounts": [
{
"name": "withdrawFromAvailable",
"accounts": [
{ "name": "vaultState", ... },
{ "name": "eventAuthority", ... },
{ "name": "program", ... }
]
},
{
"name": "withdrawFromReserveAccounts",
"accounts": [
{ "name": "vaultState", ... }
]
},
{ "name": "eventAuthority", ... },
{ "name": "program", ... }
]
}
generates:
pub struct Withdraw {
pub vault_state: Pubkey, // from withdrawFromAvailable
pub event_authority: Pubkey, // from withdrawFromAvailable
pub program: Pubkey, // from withdrawFromAvailable
pub vault_state: Pubkey, // DUPLICATE - from withdrawFromReserveAccounts
pub event_authority: Pubkey, // DUPLICATE - top level
pub program: Pubkey, // DUPLICATE - top level
}
sample IDL from kamino that exhibits this issue:
https://github.com/Kamino-Finance/klend-sdk/blob/master/src/idl/kvault.json
Not seeing any visitor that would help here, but maybe im missing something? expected behaviour would just be field dedup