Closed statictype closed 10 months ago
I run several tests and found out that source
, spec.constructors
, types
, version
are the only values required and verified before calling contract api instantiate
to get dry run results. No other metadata is being checked or validated, In my case I don't get a ContractReverted
error, the deployment is successful but ui is not able to detect how to interact with the contract. dryRun call doesn't throw any error either.
Do we want to add further metadata validation at the ui level? it seems that api endpoints wont complain about malformatted metadata in some cases.
@gaboesquivel the issue description is a bit confusing, sorry about that. the problem doesn't happen on contract upload, but on re-instantiation when you update the metadata. in order to reproduce, one must follow these steps.
This happens because contract reversion is not returned as a dry-run error. We must inspect the flags and decode the dry-run result. On the interact page (where we perform contract calls on deployed contracts) we have a way to do that, but it's not implemented for instantiation yet. Would be nice if we could reuse the UI and logic for contract call dry run in the instantiation flow. Hope that makes more sense!
Trying to upload a contract with the wrong metadata should result in a failed dry-run, however the dry run is successful and the instantiation fails
Similarly to the call dry-run, the results should be decoded and shown to the user.
https://github.com/paritytech/contracts-ui/blob/master/src/helpers/output.ts