Skip to content

[renderers-rust] Generated rust arrays longer than 32 do not serde Serialize #184

@wjthieme

Description

@wjthieme

Arrays longer than 32 cannot be Serialized with serde directly (catch-32). I suspect that is why the #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))] proc macro is added to array fields longer than 32.

This however still fails with the following error:

the trait bound `serde_with::Bytes: SerializeAs<[T; N]>` is not satisfied

Example: The TickArray account in https://github.com/orca-so/whirlpools/tree/main/rust-sdk/client when compiled with serde feature enabled. This account has a field pub ticks: [Tick; 88] which it fails on.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions