FuelLabs / fuel-vm

Fuel v2 interpreter in Rust
Other
358 stars 88 forks source link

Update `Interpreter::transact` work with `Script` only #251

Open xgreenx opened 2 years ago

xgreenx commented 2 years ago
image

Interpreter::transact accepts Create and Script transactions. But we don't execute any script on Create, and it seems redundant and not clear that transact support both transactions. Interpreter already provides the deploy method for the Create transaction, so transact now can work only with Script, and we can remove support of Create.

It is breaking change and requires the adaptation of fuel-core and fuel-rs.

Voxelot commented 2 years ago

One thing to note, we'd need to come up with an alternate way to set the change outputs on create txs for any unused fees. Deploy currently only inserts the contract into state without any alterations on the transaction itself.

xgreenx commented 2 years ago

Deploy return altered Create with actual outputs

image