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

test: snapshot tests for `storage_types` contract dryrun results #470

Closed peetzweg closed 1 year ago

peetzweg commented 1 year ago

adds snapshot testing of the dryrun results of the functions from the "storage_types" contract. Contract source can be found here: https://github.com/paritytech/ink/pull/1762

Screenshot 2023-04-27 at 15 47 15
netlify[bot] commented 1 year ago

Deploy Preview for contracts-ui ready!

Name Link
Latest commit 30a806c17d2019fda6606ed063cdf61ed815dd99
Latest deploy log https://app.netlify.com/sites/contracts-ui/deploys/645a4eeb394333000891d0d1
Deploy Preview https://deploy-preview-470--contracts-ui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

peetzweg commented 1 year ago

The decoded values for Option<Some> and Option<None> look wrong to me, wdyt @statictype ?

https://github.com/paritytech/contracts-ui/pull/470/files#diff-5558a07e3fdf5db8ec5334fb5ab01576ce619c6b3e6094da25966fe1f2d5e04cR22-R27

statictype commented 1 year ago

The decoded values for Option and Option look wrong to me, wdyt @statictype

It's correct actually, the Option returns nothing in the Some branch

peetzweg commented 1 year ago

The decoded values for Option and Option look wrong to me, wdyt @statictype

It's correct actually, the Option returns nothing in the Some branch

Ah true, I forgot to return something else than the unit value. I adapted the contract and updated this branch. Will return a bool for Ok Result and Some Option.

Furthermore I removed the code related to the Mapping type. Afaik an ink message is not able to return a whole mapping only individual values or an array.

https://github.com/paritytech/ink/pull/1762#commits-pushed-c35b47a