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({ signTransaction: PropTypes.object.isRequired })
]).isRequired,
signerstore: PropTypes.object.isRequired
signerStore: PropTypes.object.isRequired
};
static defaultProps = {
@ -45,7 +45,7 @@ export default class RequestPending extends Component {
};
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) {
const { sign } = payload;
@ -63,7 +63,7 @@ export default class RequestPending extends Component {
onConfirm={ this.onConfirm }
onReject={ onReject }
origin={ origin }
signerstore={ signerstore }
signerStore={ signerStore }
/>
);
}
@ -83,7 +83,7 @@ export default class RequestPending extends Component {
onConfirm={ this.onConfirm }
onReject={ onReject }
origin={ origin }
signerstore={ signerstore }
signerStore={ signerStore }
transaction={ transaction }
/>
);

View File

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

View File

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

View File

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

View File

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

View File

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