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

fix: #513 sign with injected wallets on local node #527

Conversation

peetzweg
Copy link
Collaborator

@peetzweg peetzweg commented Nov 20, 2023

Resolves #513/#520 by referring to the selected account if it's a testing account or not and acting accordingly.

This is the actual change:
https://github.com/paritytech/contracts-ui/pull/527/files#diff-d22473d5f78c6d4516163586c619fa5d61e960611e085cd39c676ab0afe72e81R41-R53

The rest just got reformatted due to a now shorter line:
https://github.com/paritytech/contracts-ui/pull/527/files#diff-d22473d5f78c6d4516163586c619fa5d61e960611e085cd39c676ab0afe72e81R56-R93

@peetzweg peetzweg linked an issue Nov 20, 2023 that may be closed by this pull request
Copy link

netlify bot commented Nov 20, 2023

Deploy Preview for contracts-ui ready!

Name Link
🔨 Latest commit 8fd0d50
🔍 Latest deploy log https://app.netlify.com/sites/contracts-ui/deploys/655dccfd8c08e7000885f770
😎 Deploy Preview https://deploy-preview-527--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 configuration.

Copy link

cypress bot commented Nov 20, 2023

Passing run #284 ↗︎

0 61 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

unsubscribe from extrinsic in error case
Project: Contracts UI Commit: 8fd0d50c94
Status: Passed Duration: 01:52 💡
Started: Nov 22, 2023 9:44 AM Ended: Nov 22, 2023 9:46 AM

Review all test suite changes for PR #527 ↗︎

SkymanOne
SkymanOne previously approved these changes Nov 21, 2023
Copy link

@SkymanOne SkymanOne left a comment

Choose a reason for hiding this comment

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

LGTM! Just few nits.

src/ui/contexts/TransactionsContext.tsx Show resolved Hide resolved
src/ui/contexts/TransactionsContext.tsx Outdated Show resolved Hide resolved
Copy link

@SkymanOne SkymanOne left a comment

Choose a reason for hiding this comment

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

Looks way cleaner

onError && onError(result);

unsubscribe();
throw new Error(message);

Choose a reason for hiding this comment

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

Maybe we can provide a brief reason behind transaction failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I lines 77-80 we try to decode the given error with the metadata we have. The raw result gets passed along to a potential error handler, onError and last but not least we throw a proper Error with a generic or decoded error message. Depending how the rest is implemented the error is caught or an onError provided, which then presents the error to the user somehow, either a toast popping up or a failure message.

I think that's all we could do here. 🤔

Choose a reason for hiding this comment

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

Ah, my bad, did not notice the error decoding

@peetzweg peetzweg merged commit 7331f22 into master Nov 24, 2023
10 checks passed
@peetzweg peetzweg deleted the 513-prompt-to-unlock-account-when-interacting-with-actual-wallet-accounts branch November 24, 2023 15:58
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.

Prompt to unlock account when interacting with actual wallet accounts
2 participants