Consistent store naming in the Signer components (#4996)

This commit is contained in:
Jaco Greeff 2017-03-22 16:39:40 +01:00 committed by Gav Wood
parent 044d070667
commit 1879dbca8a
6 changed files with 19 additions and 19 deletions

View File

@ -36,7 +36,7 @@ export default class RequestPending extends Component {
PropTypes.shape({ sign: PropTypes.object.isRequired }), PropTypes.shape({ sign: PropTypes.object.isRequired }),
PropTypes.shape({ signTransaction: PropTypes.object.isRequired }) PropTypes.shape({ signTransaction: PropTypes.object.isRequired })
]).isRequired, ]).isRequired,
signerstore: PropTypes.object.isRequired signerStore: PropTypes.object.isRequired
}; };
static defaultProps = { static defaultProps = {
@ -45,7 +45,7 @@ export default class RequestPending extends Component {
}; };
render () { render () {
const { className, date, focus, gasLimit, id, isSending, netVersion, onReject, payload, signerstore, origin } = this.props; const { className, date, focus, gasLimit, id, isSending, netVersion, onReject, payload, signerStore, origin } = this.props;
if (payload.sign) { if (payload.sign) {
const { sign } = payload; const { sign } = payload;
@ -63,7 +63,7 @@ export default class RequestPending extends Component {
onConfirm={ this.onConfirm } onConfirm={ this.onConfirm }
onReject={ onReject } onReject={ onReject }
origin={ origin } origin={ origin }
signerstore={ signerstore } signerStore={ signerStore }
/> />
); );
} }
@ -83,7 +83,7 @@ export default class RequestPending extends Component {
onConfirm={ this.onConfirm } onConfirm={ this.onConfirm }
onReject={ onReject } onReject={ onReject }
origin={ origin } origin={ origin }
signerstore={ signerstore } signerStore={ signerStore }
transaction={ transaction } transaction={ transaction }
/> />
); );

View File

@ -47,7 +47,7 @@ export default class SignRequest extends Component {
id: PropTypes.object.isRequired, id: PropTypes.object.isRequired,
isFinished: PropTypes.bool.isRequired, isFinished: PropTypes.bool.isRequired,
netVersion: PropTypes.string.isRequired, netVersion: PropTypes.string.isRequired,
signerstore: PropTypes.object.isRequired, signerStore: PropTypes.object.isRequired,
className: PropTypes.string, className: PropTypes.string,
focus: PropTypes.bool, focus: PropTypes.bool,
@ -67,9 +67,9 @@ export default class SignRequest extends Component {
}; };
componentWillMount () { componentWillMount () {
const { address, signerstore } = this.props; const { address, signerStore } = this.props;
signerstore.fetchBalance(address); signerStore.fetchBalance(address);
} }
render () { render () {
@ -106,8 +106,8 @@ export default class SignRequest extends Component {
renderDetails () { renderDetails () {
const { api } = this.context; const { api } = this.context;
const { address, data, netVersion, origin, signerstore } = this.props; const { address, data, netVersion, origin, signerStore } = this.props;
const { balances, externalLink } = signerstore; const { balances, externalLink } = signerStore;
const balance = balances[address]; const balance = balances[address];

View File

@ -28,7 +28,7 @@ const store = {
describe('views/Signer/components/SignRequest', () => { describe('views/Signer/components/SignRequest', () => {
it('renders', () => { it('renders', () => {
expect(shallow( expect(shallow(
<SignRequest signerstore={ store } />, <SignRequest signerStore={ store } />,
)).to.be.ok; )).to.be.ok;
}); });
}); });

View File

@ -48,7 +48,7 @@ class TransactionPending extends Component {
onConfirm: PropTypes.func.isRequired, onConfirm: PropTypes.func.isRequired,
onReject: PropTypes.func.isRequired, onReject: PropTypes.func.isRequired,
origin: PropTypes.any, origin: PropTypes.any,
signerstore: PropTypes.object.isRequired, signerStore: PropTypes.object.isRequired,
transaction: PropTypes.shape({ transaction: PropTypes.shape({
condition: PropTypes.object, condition: PropTypes.object,
data: PropTypes.string, data: PropTypes.string,
@ -75,10 +75,10 @@ class TransactionPending extends Component {
gasPrice: this.props.transaction.gasPrice.toFixed() gasPrice: this.props.transaction.gasPrice.toFixed()
}); });
hwstore = HardwareStore.get(this.context.api); hardwareStore = HardwareStore.get(this.context.api);
componentWillMount () { componentWillMount () {
const { signerstore, transaction } = this.props; const { signerStore, transaction } = this.props;
const { from, gas, gasPrice, to, value } = transaction; const { from, gas, gasPrice, to, value } = transaction;
const fee = tUtil.getFee(gas, gasPrice); // BigNumber object const fee = tUtil.getFee(gas, gasPrice); // BigNumber object
@ -88,7 +88,7 @@ class TransactionPending extends Component {
this.setState({ gasPriceEthmDisplay, totalValue, gasToDisplay }); this.setState({ gasPriceEthmDisplay, totalValue, gasToDisplay });
this.gasStore.setEthValue(value); this.gasStore.setEthValue(value);
signerstore.fetchBalances([from, to]); signerStore.fetchBalances([from, to]);
} }
render () { render () {
@ -98,13 +98,13 @@ class TransactionPending extends Component {
} }
renderTransaction () { renderTransaction () {
const { accounts, className, focus, id, isSending, netVersion, origin, signerstore, transaction } = this.props; const { accounts, className, focus, id, isSending, netVersion, origin, signerStore, transaction } = this.props;
const { totalValue } = this.state; const { totalValue } = this.state;
const { balances, externalLink } = signerstore; const { balances, externalLink } = signerStore;
const { from, value } = transaction; const { from, value } = transaction;
const fromBalance = balances[from]; const fromBalance = balances[from];
const account = accounts[from] || {}; const account = accounts[from] || {};
const disabled = account.hardware && !this.hwstore.isConnected(from); const disabled = account.hardware && !this.hardwareStore.isConnected(from);
return ( return (
<div className={ `${styles.container} ${className}` }> <div className={ `${styles.container} ${className}` }>

View File

@ -101,7 +101,7 @@ class Embedded extends Component {
onReject={ actions.startRejectRequest } onReject={ actions.startRejectRequest }
origin={ origin } origin={ origin }
payload={ payload } payload={ payload }
signerstore={ this.store } signerStore={ this.store }
/> />
); );
} }

View File

@ -141,7 +141,7 @@ class RequestsPage extends Component {
onReject={ actions.startRejectRequest } onReject={ actions.startRejectRequest }
origin={ origin } origin={ origin }
payload={ payload } payload={ payload }
signerstore={ this.store } signerStore={ this.store }
/> />
); );
} }