I'm wondering if the saturating_adds here might be better as checked_add? I'm unclear on the expected behaviour if the written_size exceeds usize here, but it seems like under-reporting the number of bytes might be worse than just panicking especially because we essentially never ever expect this to happen for Wormhole.
Fun fact... I'm looking into removing this written size method from the trait. This sort of requirement is better suited for the TypePrefixedPayload trait. So we can remove this once I get around to updating the wormhole_io crate.
I agree. Added it here: https://github.com/wormhole-foundation/example-liquidity-layer/pull/94/commits/7cf200c8d8d70c176068b8cb9fb7fcb5bce62b50.
Fun fact... I'm looking into removing this written size method from the trait. This sort of requirement is better suited for the
TypePrefixedPayload
trait. So we can remove this once I get around to updating the wormhole_io crate.