Skip to content

Commit

Permalink
Merge pull request #53 from casper-ecosystem/hotfix/v0.4.0
Browse files Browse the repository at this point in the history
Hotfix/v0.4.0: Disable Importing Accounts
  • Loading branch information
George-cl authored May 5, 2021
2 parents d5fc914 + 6815aed commit 62bb6f5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casperlabs-signer",
"version": "0.3.9",
"version": "0.4.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "0.3.9",
"version": "0.4.0",
"name": "CasperLabs Signer",
"author": "https://casperlabs.io",
"description": "CasperLabs Signer tool for signing transactions on the blockchain.",
Expand Down
14 changes: 10 additions & 4 deletions src/popup/components/AccountPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import { TextFieldWithFormState } from './Forms';
import withStyles from '@material-ui/core/styles/withStyles';
import { decodeBase64 } from 'tweetnacl-ts';
import { encodeBase16 } from 'casper-client-sdk';

const styles = (theme: Theme) =>
createStyles({
Expand Down Expand Up @@ -203,16 +204,21 @@ class AccountPage extends React.Component<
<TextFieldWithFormState
fullWidth
InputProps={{ readOnly: true, disabled: true }}
label="Public Key (Base64)"
label="Public Key"
id="create-public-key"
value={formData.publicKeyBase64.$ ? formData.publicKeyBase64.$ : ''}
value={
// TODO: This is hard coding the ed25519 prefix but will soon be extended to support secp256k1
formData.publicKeyBase64.$
? '01' + encodeBase16(decodeBase64(formData.publicKeyBase64.$))
: ''
}
/>
<TextFieldWithFormState
fullWidth
InputProps={{ readOnly: true, disabled: true }}
label="Private Key (Base64)"
label="Secret Key (Base64)"
placeholder="Base64 encoded Ed25519 secret key"
id="create-private-key"
id="create-secret-key"
defaultValue={formData.privateKeyBase64.value}
/>
<FormControlLabel
Expand Down
21 changes: 14 additions & 7 deletions src/popup/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,17 @@ class Home extends React.Component<Props, {}> {
{this.props.authContainer.userAccounts.length > 0 ? (
<Grid item className={this.props.classes.alignCenter}>
<img src={logo} alt="logo" width={120} />
<Typography variant={'h6'} align={'center'}>
You have {this.props.authContainer.userAccounts.length} account
key(s)
</Typography>
{this.props.authContainer.userAccounts.length > 1 ? (
<Typography variant={'h6'} align={'center'}>
You have {this.props.authContainer.userAccounts.length}{' '}
account keys
</Typography>
) : (
<Typography variant={'h6'} align={'center'}>
You have {this.props.authContainer.userAccounts.length}{' '}
account key
</Typography>
)}
{this.props.authContainer.selectedUserAccount && (
<Typography variant={'h6'} align={'center'}>
Active key:{' '}
Expand All @@ -145,13 +152,13 @@ class Home extends React.Component<Props, {}> {
<Grid item className={this.props.classes.alignCenter}>
<AddCircleIcon style={{ color: '#e24c2c', fontSize: '4rem' }} />
<Typography variant={'h5'} align={'center'}>
Please create or import an account to get started
Please create an account to get started
</Typography>
</Grid>
)}

<Grid item>
<FormControl fullWidth className={this.props.classes.margin}>
{/* <FormControl fullWidth className={this.props.classes.margin}>
<Button
aria-label="This will open a new window to import a key to your vault"
component={Link}
Expand All @@ -164,7 +171,7 @@ class Home extends React.Component<Props, {}> {
>
Import Account
</Button>
</FormControl>
</FormControl> */}

<FormControl fullWidth className={this.props.classes.margin}>
<Button
Expand Down

0 comments on commit 62bb6f5

Please sign in to comment.