Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve contract-transfer example #789

Merged
merged 2 commits into from
May 10, 2021

Conversation

cmichi
Copy link
Collaborator

@cmichi cmichi commented May 10, 2021

This PR makes was_it_ten fail if the payment is not exactly ten. This is better, since the method can only be executed as a transaction (and not as RPC), but our UI's don't show the return value of a transaction. So the bool which was previously returned by was_it_ten was not actually visible in the UI. But a trapped contract is visible.

This also makes it way easier to test the contract in ink-waterfall.

@cmichi cmichi requested a review from Robbepop May 10, 2021 12:06
Copy link
Collaborator

@Robbepop Robbepop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future we should exchange this with a Result type once those properly trigger reverts.

@cmichi cmichi merged commit 342d79e into master May 10, 2021
@cmichi cmichi deleted the cmichi-update-contract-transfer-example branch May 10, 2021 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants