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

feat: add "Build consent message" to demo #380

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

peterpeterparker
Copy link
Member

Motivation

To test manually or with E2E test locally, it's handy to add a "Build consent message" call to action in the /dev panel of the demo.

amount: 1n * (E8S_PER_ICP / 2n)
};

await wallet?.icrc1Transfer({
Copy link
Contributor

Choose a reason for hiding this comment

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

should there be an if condition beforehand to check if wallet is non-nullish? I see that you put it in the html part, but not in this function

Copy link
Member Author

Choose a reason for hiding this comment

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

If the demo were a real app, yes, I would add an if statement and display an error. However, since it is primarily intended for E2E testing, ignoring the fact that the wallet would not be initialized here is acceptable. If the wallet fails to perform any action, the related test would fail to validate the process. Therefore, I think it's fine, but I don't have a strong opinion either way.

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