Skip to content

Commit

Permalink
Consistent store naming in the Signer components (openethereum#4996)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored and gavofyork committed Mar 22, 2017
1 parent 044d070 commit 1879dbc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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;
Expand All @@ -63,7 +63,7 @@ export default class RequestPending extends Component {
onConfirm={ this.onConfirm }
onReject={ onReject }
origin={ origin }
signerstore={ signerstore }
signerStore={ signerStore }
/>
);
}
Expand All @@ -83,7 +83,7 @@ export default class RequestPending extends Component {
onConfirm={ this.onConfirm }
onReject={ onReject }
origin={ origin }
signerstore={ signerstore }
signerStore={ signerStore }
transaction={ transaction }
/>
);
Expand Down
10 changes: 5 additions & 5 deletions js/src/views/Signer/components/SignRequest/signRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 () {
Expand Down Expand Up @@ -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];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const store = {
describe('views/Signer/components/SignRequest', () => {
it('renders', () => {
expect(shallow(
<SignRequest signerstore={ store } />,
<SignRequest signerStore={ store } />,
)).to.be.ok;
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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 () {
Expand All @@ -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}` }>
Expand Down
2 changes: 1 addition & 1 deletion js/src/views/Signer/containers/Embedded/embedded.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Embedded extends Component {
onReject={ actions.startRejectRequest }
origin={ origin }
payload={ payload }
signerstore={ this.store }
signerStore={ this.store }
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class RequestsPage extends Component {
onReject={ actions.startRejectRequest }
origin={ origin }
payload={ payload }
signerstore={ this.store }
signerStore={ this.store }
/>
);
}
Expand Down

0 comments on commit 1879dbc

Please sign in to comment.