use-ink / contracts-ui

Web application for deploying wasm smart contracts on Substrate chains that include the FRAME contracts pallet
https://contracts-ui.substrate.io/
GNU General Public License v3.0
61 stars 44 forks source link

Reevaluate dry run result after contract call #488

Closed peetzweg closed 1 year ago

peetzweg commented 1 year ago

Describe the bug When calling a message on a contract via the contract-ui I get a result shown of a dry run. Once the call has been made to the contract the result of the dry run might change as the contract state could have been modified. So the dry run result needs to be reevaluated once a call to a contract has been made. This is currently not the case, so the dry run results are not updated after a contract call, showing outdated results.

To Reproduce Using the dns examples contract, we can register hashes. First showing a successful dry run for not yet registered hashes, however this result should change once the call to the contract has been made. Check out the video below showing registering on of hashes.

  1. dry run shows success for registering 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  2. call contract to register hash
  3. call successful
  4. dry run still shows old data, indicating success to register 0xaaa..
  5. call contract to register hash 0xaaa.. again
  6. contract call fails although dry run indicates success => bug

Expected behavior

The dry run results should have been updated and automatically after step 3. above.

Screenshots

https://github.com/paritytech/contracts-ui/assets/839848/9e01c0c7-848d-4363-af22-f9a90593f26c

peetzweg commented 1 year ago

Closing as duplicate of #445