Skip to content

Commit

Permalink
Adding more details to keycert import to trace errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Sep 20, 2022
1 parent bc9cd96 commit 0e6bc2d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
10 changes: 9 additions & 1 deletion app/modules/main/actions/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,15 @@ export function returnKeyCertificateDecrypted(cert) {
}
return dispatch({
type: types.ACCOUNT_KEY_CERTIFICATE_DECRYPTED_MISMATCH,
payload: 'The key certificate does not match the account specified.'
payload: {
account: cert.account,
auth,
blockchain: cert.blockchain.chainId,
data: result.data.permissions,
message: 'The key certificate does not match the account specified.',
publicKey: cert.publicKey,
server: cert.blockchain.node,
}
});
}
return dispatch({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import compose from 'lodash/fp/compose';

import { Button, Divider, Header, Message, Segment } from 'semantic-ui-react';
import { Accordion, Button, Divider, Header, Icon, Message, Segment } from 'semantic-ui-react';

import AccountSetupElementsWordsList from '../Words/List';
import GlobalFormFieldWords from '../../../../../../../../shared/components/Global/Form/Field/Words';

class AccountSetupRecoverEncryptionWords extends Component<Props> {
state = {
// Encryption Keys (6 words)
encryption: [],
encryption: ['shine', 'aware', 'copper', 'turkey', 'sting', 'logic'],
expandedError: false,
}
addEncryptionWord = (value) => {
this.setState({
Expand All @@ -35,9 +36,13 @@ class AccountSetupRecoverEncryptionWords extends Component<Props> {
this.props.setEncryptionWords(this.state.encryption);
this.props.onClick();
}
expandError = () => {
this.setState({ expandedError: !this.state.expandedError })
}
render() {
const {
encryption,
expandedError,
} = this.state;
const {
error
Expand Down Expand Up @@ -79,11 +84,26 @@ class AccountSetupRecoverEncryptionWords extends Component<Props> {
}
{(error)
? (
<Message
error
header={error.message}
content={`Check that the encryption words above match. If they do, go back and ensure the network, account name, and mnemonic words also match. (Error: ${JSON.stringify(error)})`}
/>
<div>
<Message
error
header={error.message}
content={`Check that the encryption words above match. If they do, go back and ensure the network, account name, and mnemonic words also match.`}
/>
<Accordion>
<Accordion.Title
active={expandedError}
index={0}
onClick={this.expandError}
>
<Icon name='dropdown' />
Expand error details for troubleshooting
</Accordion.Title>
<Accordion.Content active={expandedError}>
<pre>{JSON.stringify(error, null, '\t')}</pre>
</Accordion.Content>
</Accordion>
</div>
)
: (
<Button
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@babel/preset-typescript": "^7.14.5",
"@greymass/account-creation": "^0.0.1",
"@greymass/anchor-link-session-manager": "0.3.1",
"@greymass/eosio": "0.6.1",
"@greymass/eosio": "^0.6.4",
"@greymass/eosio-resources": "0.7.0",
"@greymass/keycert": "^1.4.0",
"@greymass/keycert-pdf": "^1.2.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1492,10 +1492,10 @@
bn.js "^4.11.9"
tslib "^2.1.0"

"@greymass/[email protected].1":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@greymass/eosio/-/eosio-0.6.1.tgz#2af601b6f38a37cb3c78b62d80fd293b80814f62"
integrity sha512-K9VmejZmXHczuLBdQzEQayzISEG/s1PQ9awNf3nMeiVOnmjC5jnw/qNatY1PDpVhXsu+FcW59EAoCEWpuKnrfA==
"@greymass/[email protected].4", "@greymass/eosio@^0.6.4":
version "0.6.4"
resolved "https://registry.yarnpkg.com/@greymass/eosio/-/eosio-0.6.4.tgz#9baf8aadacad69d61be20a53e235a9b4cbd97ffa"
integrity sha512-Wxr46tgh4J5Nm5tdTx5btJ/MZu36bZfxxCXfWRDAMfOn6FFFwgcZpY/sEv5eH9L2rCvxVrZtd2R8vPGsF/amQQ==
dependencies:
bn.js "^4.11.9"
brorand "^1.1.0"
Expand Down

0 comments on commit 0e6bc2d

Please sign in to comment.