FuelLabs / fuels-ts

Fuel Network Typescript SDK
https://docs.fuel.network/docs/fuels-ts/
Apache License 2.0
44.4k stars 1.32k forks source link

chore!: remove `InvocationResult` from `program` package #2652

Open Torres-ssf opened 2 days ago

Torres-ssf commented 2 days ago

Summary

Follow-up:

Breaking Changes:

The following classes were removed:

Torres-ssf commented 16 hours ago

In the breaking change notes, may be worth fleshing out the may breaking change (that we have documented) :)

@petertonysmith94 I am unsure if this would be helpful. The changes here are breaking changes because the class InvocationResult was being exported by fuels.

However, this class was only used internally when assembling the return for contract/script calls originated from the BaseInvocationScope. The returned properties are exactly the same.

I cannot think of a situation where users would need to use the 2 helpers implemented here (buildDryRunResult and buildSubmitResult. That is why I've not added TS DOC @hidden tag for them.

Torres-ssf commented 14 hours ago

Should we save the idea for a greater "TX Builder" effort instead of treating it as an isolated issue?

I love the idea of simplifying things, but without a deeper story behind where this is going, it may be challenging to see the whole.

@arboleya, the code refactoring introduced here focuses on simplifying the assembly of the return value from a contract/script call within the BaseInvocationScope.

This change is primarily aimed at improving the reliability and maintainability of the code, rather than redesigning its structure.

This refactoring will be particularly beneficial when addressing this issue. By consolidating the relevant code into a single location, it will be easier to implement the necessary breaking changes associated with the issue and also to review them.

It's important to note that the structure of the returned object remains unchanged.

github-actions[bot] commented 12 hours ago

Coverage Report:

Lines Branches Functions Statements
79.61%(+0.07%) 71.42%(+0.05%) 77.24%(+0.33%) 79.7%(+0.08%)
Changed Files: | Ok | File (✨=New File) | Lines | Branches | Functions | Statements | | -- | ---------------------------------------------------------------------- | ----------------- | ----------- | ----------- | ----------------- | | 🔴 | ✨ packages/program/src/response.ts | 10%
(+10%) | 0%
(+0%) | 0%
(+0%) | 10%
(+10%) | | 🔴 | packages/program/src/utils.ts | 6.66%
(+6.66%) | 0%
(+0%) | 0%
(+0%) | 6.66%
(+6.66%) |