stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
118 stars 66 forks source link

Truncate docs stored in wasm rather than panic when length exceeded #1261

Closed leighmcculloch closed 4 months ago

leighmcculloch commented 4 months ago

What

Truncate docs stored in the wasm spec rather than panic when the length of the docs exceeds the length that can be stored in the wasm.

Why

Today the SDK panicks if any item such as a contract type, or function, contain rust docs that are more than 1kb in length. Instead of panicking the SDK should truncate since it is not critical information, and helps a developer just keep moving forward rather than having to iterate on the length of their docs.

See the following conversation: