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

[Parity Signer] Add future support for ERC-681 #1945

Merged
merged 6 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions common/components/WalletDecrypt/components/ParitySigner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ interface Props {
onUnlock(param: any): void;
}

interface SignerAddress {
address: string;
chainId: number;
}

type SignerQrContent = SignerAddress | string;

class ParitySignerDecryptClass extends PureComponent<Props> {
public render() {
return (
Expand All @@ -36,13 +43,13 @@ class ParitySignerDecryptClass extends PureComponent<Props> {
);
}

private unlockAddress = (address: string) => {
if (!isValidETHAddress(address)) {
private unlockAddress = (content: SignerQrContent) => {
if (typeof content === 'string' || !isValidETHAddress(content.address)) {
this.props.showNotification('danger', 'Not a valid address!');
return;
}

this.props.onUnlock(new ParitySignerWallet(address));
this.props.onUnlock(new ParitySignerWallet(content.address));
};
}

Expand Down
4 changes: 2 additions & 2 deletions common/containers/QrSignerModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';

import { addHexPrefix } from 'ethereumjs-util';
import translate, { translateRaw } from 'translations';
import { AppState } from 'features/reducers';
import { paritySignerActions } from 'features/paritySigner';
Expand Down Expand Up @@ -95,7 +95,7 @@ class QrSignerModal extends React.Component<Props, State> {
return;
}

this.props.finalizeSignature(signature);
this.props.finalizeSignature(addHexPrefix(signature));
this.setState({ scan: false });
};
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"npm": ">= 5.0.0"
},
"dependencies": {
"@parity/qr-signer": "0.3.1",
"@ledgerhq/hw-app-eth": "4.7.3",
"@ledgerhq/hw-transport-node-hid": "4.7.6",
"@ledgerhq/hw-transport-u2f": "4.12.0",
"@parity/qr-signer": "0.2.1",
"babel-polyfill": "6.26.0",
"bip39": "2.5.0",
"bn.js": "4.11.8",
Expand Down