fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

Support new encode/decode for `__log`

Open arboleya opened this issue 1 year ago • 1 comments

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.

arboleya avatar Jan 22 '24 15:01 arboleya

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, bool and u8 now 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 u64 length at the start.
  • Vec, Byte and Raw Slice are also encoded like a dynamic array, with a u64 length 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.

danielbate avatar Jan 23 '24 11:01 danielbate