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

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

Open danielbate opened this issue 1 year ago • 6 comments

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

  • Integration/E2E tests for UpgradeandUpload` transactions
  • Multi version E2E test infrastructure, encapsulating multiple network versions and wallet addresses

danielbate avatar May 22 '24 15:05 danielbate

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

arboleya avatar May 22 '24 16:05 arboleya

@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.

Torres-ssf avatar May 23 '24 11:05 Torres-ssf

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).

nedsalk avatar Jun 07 '24 15:06 nedsalk

@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?

petertonysmith94 avatar Jun 21 '24 09:06 petertonysmith94

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.

nedsalk avatar Jun 21 '24 16:06 nedsalk

We already got e2es for Mint TX via:

  • https://github.com/FuelLabs/fuels-ts/pull/2505

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

arboleya avatar Jun 21 '24 16:06 arboleya