Etherscan links based on netVersion identifier (#4772)

* Use netVersion to determine external links

* Update additional isTest references
This commit is contained in:
Jaco Greeff
2017-03-06 08:54:59 +01:00
committed by Gav Wood
parent 944dcdc010
commit 0b24a3d7f6
41 changed files with 217 additions and 175 deletions

View File

@@ -34,8 +34,8 @@ class TxHash extends Component {
static propTypes = {
hash: PropTypes.string.isRequired,
isTest: PropTypes.bool,
maxConfirmations: PropTypes.number,
netVersion: PropTypes.string.isRequired,
summary: PropTypes.bool
}
@@ -116,10 +116,10 @@ class TxHash extends Component {
}
render () {
const { hash, isTest, summary } = this.props;
const { hash, netVersion, summary } = this.props;
const hashLink = (
<a href={ txLink(hash, isTest) } target='_blank'>
<a href={ txLink(hash, false, netVersion) } target='_blank'>
<ShortenedHash data={ hash } />
</a>
);
@@ -255,9 +255,11 @@ class TxHash extends Component {
}
function mapStateToProps (state) {
const { isTest } = state.nodeStatus;
const { netVersion } = state.nodeStatus;
return { isTest };
return {
netVersion
};
}
export default connect(

View File

@@ -69,7 +69,9 @@ function createRedux () {
subscribe: sinon.stub(),
getState: () => {
return {
nodeStatus: { isTest: true }
nodeStatus: {
netVersion: '42'
}
};
}
};