2021-02-04 19:15:23 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import ConfirmTransactionBase from '../confirm-transaction-base';
|
2021-05-21 22:07:06 +02:00
|
|
|
import { toBuffer } from '../../../shared/modules/buffer-utils';
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
export default class ConfirmDeployContract extends Component {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
txData: PropTypes.object,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
renderData() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { t } = this.context;
|
|
|
|
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>
|
2021-04-16 17:05:13 +02:00
|
|
|
<div>{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>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
|
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()}
|
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
}
|