FuelLabs / fuels-ts

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

Integration/E2E tests for `Upgrade` and `Upload` transactions #2373

Open danielbate opened 6 months ago

danielbate commented 6 months ago

Context

Unlike Script and Create transactions, we can't create the above transaction types using the SDK. Upgrade/Upload transactions represent network state transitions.

We have unit tests for these transaction types however they only validate the bytes produced by the coders. Meaning any change to the underlying encoding specification that is not reflected in the transaction coders will mean a false positive in our test suite. We require an integration/E2E test to validate that the transaction bytes are correct as those expected by the client.

2354 attempted to solve for this by testing against hardcoded transaction IDs on devnet that are known to be of the above transaction types. The concern here is that these tests remain tied to a specific version of the network.

We should solve for the above problem but ideally the complete solution would supported different versions of the network in tandem, via multi-version E2E test infrastructure.

Problems

arboleya commented 6 months ago

Could we have integration tests for these using a local node?

Torres-ssf commented 6 months ago

@arboleya For a Mint TX yes, but unfortunately, no for Upgrade / Upload TX.

Since the TS SDK does not support submitting them, there won't be a simple way to have these 2 TX types exist in a local node.

nedsalk commented 5 months ago

An additional problem here is that we'll have devnet/testnet/mainnet, which will be different versions of fuel-core (and possibly forc), so we'll have to run the e2e tests with sdk versions compatible with those networks (e.g. via release tags).

petertonysmith94 commented 5 months ago

@arboleya For a Mint TX yes, but unfortunately, no for Upgrade / Upload TX.

Since the TS SDK does not support submitting them, there won't be a simple way to have these 2 TX types exist in a local node.

Could we submit Upgrade / Upload using the Rust SDK?

nedsalk commented 5 months ago

Could we submit Upgrade / Upload using the Rust SDK?

Yes we could, but we'd have to have a separate rust app that we'd build+run for these tests, which isn't ideal but might be the only approach we have currently. I think it would be worthwhile to investigate this avenue.

arboleya commented 5 months ago

We already got e2es for Mint TX via:

The rest may not be necessary for a long time, so I updated the issue title/desc/priority accordingly.