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

chore: remove `sway-libs` dep from testing fixtures

Open maschad opened this issue 1 year ago • 1 comments

Closes https://github.com/FuelLabs/fuels-ts/issues/2160

  • Mocks the compute_bytecode functions in the sway contracts

maschad avatar Apr 26 '24 21:04 maschad

@Dhaiwat10 @arboleya any ideas why this test would hang on CI? It works fine locally Screenshot 2024-05-07 at 4 33 09 PM

maschad avatar May 07 '24 21:05 maschad

One concern here is the docs still references the sway std lib function, so we are miss communicating the dependency. If the sway std lib signature changed, we are not in sync as we have a mocked version. I think we should be more generally referencing this as working with bytes with both a Vec<u8> and Bytes example. Thoughts?

Whether it's mocked or not wouldn't have an effect as it relates to breaking changes as we would still be using a particular version as our dependency

the benefit with this at least would be should we try to upgrade, if there is a breaking change, Rust would let us know due to it's semver toolchain - but this would still be dependent on our manual attempt to upgrade.

In summary, I'm not sure if there is an uncomplicated way to discuss working with bytecode or Vec<u8> without using a concrete example from a sway library.

maschad avatar May 10 '24 20:05 maschad

Whether it's mocked or not wouldn't have an effect as it relates to breaking changes as we would still be using a particular version as our dependency

But agreed we should remove the dependency, like you have done.

In summary, I'm not sure if there is an uncomplicated way to discuss working with bytecode or Vec without using a concrete example from a sway library.

I would personally prefer removing the reference to the sway std lib in the docs and just more generally speak about bytecode.

Some functions require you to pass in bytecode to the function. The type of the bytecode parameter is usually `Vec<u8>`, this would be handled like so:

<-- code snippet -->

danielbate avatar May 12 '24 07:05 danielbate

I would personally prefer removing the reference to the sway std lib in the docs and just more generally speak about bytecode.

2f6af7d

maschad avatar May 13 '24 19:05 maschad

Coverage Report:

Lines Branches Functions Statements
79.54%(+0%) 69.84%(+0%) 77.12%(+0%) 79.65%(+0%)
Changed Files:

Coverage values did not change👌.

github-actions[bot] avatar May 13 '24 22:05 github-actions[bot]