2018-06-23 08:52:45 +02:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import ethUtil from 'ethereumjs-util'
|
|
|
|
import ConfirmTransactionBase from '../confirm-transaction-base'
|
|
|
|
|
|
|
|
export default class ConfirmDeployContract extends Component {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
|
|
|
}
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
txData: PropTypes.object,
|
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
renderData() {
|
2018-06-23 08:52:45 +02:00
|
|
|
const { t } = this.context
|
2020-11-03 00:41:28 +01:00
|
|
|
const { txData: { origin, txParams: { data } = {} } = {} } = this.props
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="confirm-page-container-content__data">
|
|
|
|
<div className="confirm-page-container-content__data-box">
|
|
|
|
<div className="confirm-page-container-content__data-field">
|
|
|
|
<div className="confirm-page-container-content__data-field-label">
|
2020-11-03 00:41:28 +01:00
|
|
|
{`${t('origin')}:`}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
2020-11-03 00:41:28 +01:00
|
|
|
<div>{origin}</div>
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
|
|
|
<div className="confirm-page-container-content__data-field">
|
|
|
|
<div className="confirm-page-container-content__data-field-label">
|
2020-11-03 00:41:28 +01:00
|
|
|
{`${t('bytes')}:`}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
2020-11-03 00:41:28 +01:00
|
|
|
<div>{ethUtil.toBuffer(data).length}</div>
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="confirm-page-container-content__data-box-label">
|
2020-11-03 00:41:28 +01:00
|
|
|
{`${t('hexData')}:`}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
2020-11-03 00:41:28 +01:00
|
|
|
<div className="confirm-page-container-content__data-box">{data}</div>
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2018-06-23 08:52:45 +02:00
|
|
|
return (
|
|
|
|
<ConfirmTransactionBase
|
2019-11-18 16:08:47 +01:00
|
|
|
actionKey="contractDeployment"
|
2018-06-23 08:52:45 +02:00
|
|
|
dataComponent={this.renderData()}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|