Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

fix: rename memo -> note + add bip39 mnemonic check #33

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
47,441 changes: 47,441 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"dependencies": {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only thing I'm not sure about, should it be here or in devDependencies instead? Everything else is in devDependencies, not sure why.

"bip39": "^3.0.3"
}
}
6 changes: 3 additions & 3 deletions src/containers/Wallet/Proposals/Modal/Memo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as PropTypes from 'prop-types';
import { ValidateMemo } from './_validation';
import { ValidateMemo } from '../../../common/_validation';
import { connect } from 'react-redux';
import { setTxVoteMemo } from '../../../../actions/transactions/vote';
import React from 'react';
Expand All @@ -19,8 +19,8 @@ const Memo = (props) => {
<TextArea
className="form-control seed-text-field"
error={props.input.error}
name="Memo"
placeholder="Enter Memo"
name="Note"
placeholder="Enter Note"
required={true}
rows={3}
value={props.input.value}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/Proposals/Modal/Vote.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as PropTypes from 'prop-types';
import { ValidateMemo, ValidatePassword } from './_validation';
import { ValidateMemo } from '../../../common/_validation';
import { connect } from 'react-redux';
import { txVote } from '../../../../actions/transactions/vote';
import Button from '../../../../components/Button';
Expand Down
12 changes: 0 additions & 12 deletions src/containers/Wallet/Proposals/Modal/_validation.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/containers/Wallet/Proposals/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Modal = ({
<div className="form-group">
<Label
className=""
label="Memo"
label="Note"
/>
<Memo/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Wallet/Send/Modal/Memo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const Memo = (props) => {
<TextArea
className="form-control seed-text-field"
error={props.input.error}
name="Memo"
placeholder="Enter Memo"
name="Note"
placeholder="Enter Note"
required={true}
rows={3}
value={props.input.value}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/Send/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Modal = ({
<div className="form-group">
<Label
className=""
label="Memo"
label="Note"
/>
<Memo/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Wallet/Validators/ModalDelegate/Memo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const Memo = (props) => {
<TextArea
className="form-control seed-text-field"
error={props.input.error}
name="Memo"
placeholder="Enter Memo"
name="Note"
placeholder="Enter Note"
required={true}
rows={3}
value={props.input.value}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/Validators/ModalDelegate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ModalDelegate = (props) => {
<div className="form-group">
<Label
className=""
label="Memo"
label="Note"
/>
<Memo/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Wallet/Validators/ModalRedelegate/Memo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const Memo = (props) => {
<TextArea
className="form-control seed-text-field"
error={props.input.error}
name="Memo"
placeholder="Enter Memo"
name="Note"
placeholder="Enter Note"
required={true}
rows={3}
value={props.input.value}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/Validators/ModalRedelegate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ModalRedelegate = (props) => {
<div className="form-group">
<Label
className=""
label="Memo"
label="Note"
/>
<Memo/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Wallet/Validators/ModalUnbond/Memo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const Memo = (props) => {
<TextArea
className="form-control seed-text-field"
error={props.input.error}
name="Memo"
placeholder="Enter Memo"
name="Note"
placeholder="Enter Note"
required={true}
rows={3}
value={props.input.value}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/Validators/ModalUnbond/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ModalUnbond = (props) => {
<div className="form-group">
<Label
className=""
label="Memo"
label="Note"
/>
<Memo/>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/containers/Wallet/WithdrawRewards/Modal/Memo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as PropTypes from 'prop-types';
import { ValidateMemo } from './_validation';
import { ValidateMemo } from '../../../common/_validation';
import { connect } from 'react-redux';
import { setTxWithdrawMemo } from '../../../../actions/transactions/withdraw';
import React from 'react';
Expand All @@ -19,8 +19,8 @@ const Memo = (props) => {
<TextArea
className="form-control seed-text-field"
error={props.input.error}
name="Memo"
placeholder="Enter Memo"
name="Note"
placeholder="Enter Note"
required={true}
rows={3}
value={props.input.value}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/WithdrawRewards/Modal/Withdraw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as PropTypes from 'prop-types';
import { ValidateMemo, ValidatePassword } from './_validation';
import { ValidateMemo, ValidatePassword } from '../../../common/_validation';
import { connect } from 'react-redux';
import { txWithdraw } from '../../../../actions/transactions/withdraw';
import Button from '../../../../components/Button';
Expand Down
12 changes: 0 additions & 12 deletions src/containers/Wallet/WithdrawRewards/Modal/_validation.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/containers/Wallet/WithdrawRewards/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Modal = (props) => {
<div className="form-group">
<Label
className=""
label="Memo"
label="Note"
/>
<Memo/>
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/containers/common/_validation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
const bip39 = require('bip39');

export const ValidateMemo = (value) => {
if (bip39.validateMnemonic(value.trim())) {
return new Error(
'This looks like a mnemonic. Please do not attach the mnemonic ' +
'or other sensitive data to note, as it is public and can be seen by anyone.');
}

return new Error('');
};

Expand Down
Loading