fuels-ts
fuels-ts copied to clipboard
Support new encode/decode for `__log`
New encoding/decoding was implemented for __log calls, as per:
- https://github.com/FuelLabs/sway/pull/5306
We need to start the work around the TS SDK to support it.
Full details for the changes can be found here, however here are the high level changes that we should make for the SDK.
- Types now only use the exact number of bits that they need. For example,
boolandu8now only take up a single byte. - No additional padding or alignment, as seen in #1435.
- Arrays, Tuples and fixed size String Arrays are encoded without any additional padding, and take up the size of it’s contents. A dynamic sized string will have a
u64length at the start. - Vec, Byte and Raw Slice are also encoded like a dynamic array, with a
u64length and then it's contents. - We should also look to handle versioning within our encoding services. Encoding is subject to change so we should support different coders.