Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Update to latest js-lib packages possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ltfschoen committed Jan 13, 2019
1 parent 10093dd commit ca7ec83
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/fether-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"test": "echo Skipped."
},
"dependencies": {
"@parity/electron": "https://github.com/paritytech/js-libs.git#luke-81-electron-4",
"@parity/electron": "^3.0.1",
"commander": "^2.15.1",
"commander-remaining-args": "^1.2.0",
"fether-react": "^0.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/fether-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
},
"dependencies": {
"@craco/craco": "^3.2.3",
"@parity/api": "^3.0.11",
"@parity/contracts": "^3.0.11",
"@parity/light.js": "^3.0.11",
"@parity/light.js-react": "^3.0.11",
"@parity/api": "^3.0.13",
"@parity/contracts": "^3.0.13",
"@parity/light.js": "^3.0.13",
"@parity/light.js-react": "^3.0.13",
"bignumber.js": "^8.0.1",
"bip39": "^2.5.0",
"debounce-promise": "^3.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class AccountRewritePhrase extends Component {
<AccountCard
address={address}
name={address && !name ? '(no name)' : name}
drawers={[body]}
drawers={body}
/>
);
}
Expand Down
18 changes: 13 additions & 5 deletions packages/fether-react/src/stores/createAccountStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import getParityWordlist from './utils/getParityWordlist';
const debug = Debug('createAccountStore');

const DERIVATION_PATH = "m/44'/60'/0'/0/0";
const MIN_PARITY_SIGNER_RECOVERY_WORDS = 11;
const MAX_PARITY_SIGNER_RECOVERY_WORDS = 24;
const ETHEREUM_ADDRESS_LENGTH = 40;
const JSON_VERSION = 3;

export class CreateAccountStore {
@observable
Expand All @@ -24,10 +28,10 @@ export class CreateAccountStore {
jsonString = null;

@observable
parityPhrase = null; // 12-word seed phrase
parityPhrase = null; // 11 or 12-words seed phrase (Parity Signer used to generate a 11 words recovery phrase)

@observable
bip39Phrase = null; // 12- to 24-word seed phrase
bip39Phrase = null; // 12 to 24-words seed phrase

@observable
address = null;
Expand Down Expand Up @@ -131,8 +135,8 @@ export class CreateAccountStore {
const words = phrase.split(' ');
const PARITY_WORDLIST = getParityWordlist();
if (
words.length < 12 ||
words.length > 24 ||
words.length < MIN_PARITY_SIGNER_RECOVERY_WORDS ||
words.length > MAX_PARITY_SIGNER_RECOVERY_WORDS ||
!words.every(word => PARITY_WORDLIST.has(word))
) {
throw new Error('Not a Parity phrase');
Expand All @@ -156,7 +160,11 @@ export class CreateAccountStore {

const json = JSON.parse(jsonString);

if (!json || json.address.length !== 40 || json.version !== 3) {
if (
!json ||
json.address.length !== ETHEREUM_ADDRESS_LENGTH ||
json.version !== JSON_VERSION
) {
throw new Error('File is not valid json');
}

Expand Down

0 comments on commit ca7ec83

Please sign in to comment.