mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-01 04:38:15 +00:00
Pass path properly
This commit is contained in:
parent
ca460859ac
commit
78d2b411fb
@ -65,10 +65,12 @@ class SignVerify extends Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPath() {
|
||||||
|
return this.props.selectedAccount.account.addressPath;
|
||||||
|
}
|
||||||
|
|
||||||
handleSignInput = (e) => {
|
handleSignInput = (e) => {
|
||||||
console.log('aaa', e.target);
|
|
||||||
this.setState({ sign: { [e.target.name]: e.target.value } });
|
this.setState({ sign: { [e.target.name]: e.target.value } });
|
||||||
console.log(this.state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleVerifyInput = (e) => {
|
handleVerifyInput = (e) => {
|
||||||
@ -96,50 +98,93 @@ class SignVerify extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPath() {
|
|
||||||
const { account } = this.props;
|
|
||||||
return account.addressPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { signVerifyActions } = this.props;
|
const { signVerifyActions } = this.props;
|
||||||
return (
|
return (
|
||||||
<Content>
|
<Content>
|
||||||
<Title>Sign & Verify</Title>{this.state.sign.message || 'no message'}
|
<Title>Sign & Verify</Title>
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Sign>
|
<Sign>
|
||||||
<Row>
|
<Row>
|
||||||
<Label>Address</Label>
|
<Label>Address</Label>
|
||||||
<Input name="address" value={this.state.sign.address} onChange={this.handleSignInput} height={50} type="text" disabled />
|
<Input
|
||||||
|
name="address"
|
||||||
|
value={this.state.sign.address}
|
||||||
|
onChange={this.handleSignInput}
|
||||||
|
height={50}
|
||||||
|
type="text"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Label>Message</Label>
|
<Label>Message</Label>
|
||||||
<Textarea name="message" value={this.state.sign.message} onChange={this.handleSignInput} rows="2" maxLength="255" />
|
<Textarea
|
||||||
|
name="message"
|
||||||
|
value={this.state.sign.message}
|
||||||
|
onChange={this.handleSignInput}
|
||||||
|
rows="2"
|
||||||
|
maxLength="255"
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Label>Signature</Label>
|
<Label>Signature</Label>
|
||||||
<Textarea name="signature" value={this.state.sign.signature} onChange={this.handleSign} rows="2" maxLength="255" disabled />
|
<Textarea
|
||||||
|
name="signature"
|
||||||
|
value={this.state.sign.signature}
|
||||||
|
onChange={this.handleSign}
|
||||||
|
rows="2"
|
||||||
|
maxLength="255"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<RowButtons>
|
<RowButtons>
|
||||||
<Button onClick={this.clearVerify} isWhite>Clear</Button>
|
<Button
|
||||||
<StyledButton onClick={() => signVerifyActions.sign(this.getPath(), this.state.sign.message)}>Sign</StyledButton>
|
onClick={this.clearVerify}
|
||||||
|
isWhite
|
||||||
|
>Clear
|
||||||
|
</Button>
|
||||||
|
<StyledButton
|
||||||
|
onClick={() => signVerifyActions.sign(this.getPath(), this.state.sign.message)}
|
||||||
|
>Sign
|
||||||
|
</StyledButton>
|
||||||
</RowButtons>
|
</RowButtons>
|
||||||
</Sign>
|
</Sign>
|
||||||
<Verify>
|
<Verify>
|
||||||
<Row>
|
<Row>
|
||||||
<Label>Address</Label>
|
<Label>Address</Label>
|
||||||
<Input name="address" value={this.state.verify.address} onChange={this.handleVerifyInput} type="text" />
|
<Input
|
||||||
|
name="address"
|
||||||
|
value={this.state.verify.address}
|
||||||
|
onChange={this.handleVerifyInput}
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Label>Message</Label>
|
<Label>Message</Label>
|
||||||
<Textarea name="message" value={this.state.verify.message} onChange={this.handleVerifyInput} rows="4" maxLength="255" />
|
<Textarea
|
||||||
|
name="message"
|
||||||
|
value={this.state.verify.message}
|
||||||
|
onChange={this.handleVerifyInput}
|
||||||
|
rows="4"
|
||||||
|
maxLength="255"
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Label>Signature</Label>
|
<Label>Signature</Label>
|
||||||
<Textarea name="signature" value={this.state.verify.signature} onChange={this.handleVerifyInput} rows="4" maxLength="255" />
|
<Textarea
|
||||||
|
name="signature"
|
||||||
|
value={this.state.verify.signature}
|
||||||
|
onChange={this.handleVerifyInput}
|
||||||
|
rows="4"
|
||||||
|
maxLength="255"
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<RowButtons>
|
<RowButtons>
|
||||||
<Button onClick={this.clearSign} isWhite>Clear</Button>
|
<Button
|
||||||
|
onClick={this.clearSign}
|
||||||
|
isWhite
|
||||||
|
>Clear
|
||||||
|
</Button>
|
||||||
<StyledButton>Verify</StyledButton>
|
<StyledButton>Verify</StyledButton>
|
||||||
</RowButtons>
|
</RowButtons>
|
||||||
</Verify>
|
</Verify>
|
||||||
|
Loading…
Reference in New Issue
Block a user