- { this.shortHash(hash) }
+
+ { hash }
);
}
@@ -206,7 +206,10 @@ export class LocalTransaction extends BaseTransaction {
From
- Gas Price / Gas
+ Gas Price
+ |
+
+ Gas
|
Status
@@ -224,18 +227,18 @@ export class LocalTransaction extends BaseTransaction {
toggleResubmit = () => {
const { transaction } = this.props;
- const { isResubmitting, gasPrice } = this.state;
+ const { isResubmitting } = this.state;
- this.setState({
+ const nextState = {
isResubmitting: !isResubmitting
- });
+ };
- if (gasPrice === null) {
- this.setState({
- gasPrice: `0x${transaction.gasPrice.toString(16)}`,
- gas: `0x${transaction.gas.toString(16)}`
- });
+ if (!isResubmitting) {
+ nextState.gasPrice = api.util.fromWei(transaction.gasPrice, 'shannon').toNumber();
+ nextState.gas = transaction.gas.div(1000000).toNumber();
}
+
+ this.setState(nextState);
};
setGasPrice = el => {
@@ -251,16 +254,15 @@ export class LocalTransaction extends BaseTransaction {
};
sendTransaction = () => {
- const { transaction } = this.props;
+ const { transaction, status } = this.props;
const { gasPrice, gas } = this.state;
const newTransaction = {
from: transaction.from,
- to: transaction.to,
- nonce: transaction.nonce,
value: transaction.value,
data: transaction.input,
- gasPrice, gas
+ gasPrice: api.util.toWei(gasPrice, 'shannon'),
+ gas: new BigNumber(gas).mul(1000000)
};
this.setState({
@@ -268,11 +270,21 @@ export class LocalTransaction extends BaseTransaction {
isSending: true
});
- const closeSending = () => this.setState({
- isSending: false,
- gasPrice: null,
- gas: null
- });
+ const closeSending = () => {
+ this.setState({
+ isSending: false,
+ gasPrice: null,
+ gas: null
+ });
+ };
+
+ if (transaction.to) {
+ newTransaction.to = transaction.to;
+ }
+
+ if (!['mined', 'replaced'].includes(status)) {
+ newTransaction.nonce = transaction.nonce;
+ }
api.eth.sendTransaction(newTransaction)
.then(closeSending)
@@ -290,9 +302,9 @@ export class LocalTransaction extends BaseTransaction {
const resubmit = isSending ? (
'sending...'
) : (
-
+
+
);
return (
@@ -308,7 +320,8 @@ export class LocalTransaction extends BaseTransaction {
|
{ this.renderGasPrice(transaction) }
-
+ |
+
{ this.renderGas(transaction) }
|
@@ -345,9 +358,9 @@ export class LocalTransaction extends BaseTransaction {
return (
|
-
+
+
|
{ this.renderHash(transaction.hash) }
@@ -357,20 +370,24 @@ export class LocalTransaction extends BaseTransaction {
|
+ shannon
+ |
+
+ MGas
|
-
+
+
|
);
diff --git a/js/src/dapps/signaturereg.js b/js/src/dapps/signaturereg.js
index c20e45170ff..61b67aab027 100644
--- a/js/src/dapps/signaturereg.js
+++ b/js/src/dapps/signaturereg.js
@@ -16,6 +16,7 @@
import ReactDOM from 'react-dom';
import React from 'react';
+import { AppContainer } from 'react-hot-loader';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
@@ -27,6 +28,21 @@ import '../../assets/fonts/RobotoMono/font.css';
import './style.css';
ReactDOM.render(
- ,
+
+
+ ,
document.querySelector('#container')
);
+
+if (module.hot) {
+ module.hot.accept('./signaturereg/Application/index.js', () => {
+ require('./signaturereg/Application/index.js');
+
+ ReactDOM.render(
+
+
+ ,
+ document.querySelector('#container')
+ );
+ });
+}
diff --git a/js/src/dapps/tokendeploy.js b/js/src/dapps/tokendeploy.js
index a1808199e04..b6de05d0581 100644
--- a/js/src/dapps/tokendeploy.js
+++ b/js/src/dapps/tokendeploy.js
@@ -17,6 +17,7 @@
import ReactDOM from 'react-dom';
import React from 'react';
import { Redirect, Router, Route, hashHistory } from 'react-router';
+import { AppContainer } from 'react-hot-loader';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
@@ -31,13 +32,37 @@ import '../../assets/fonts/RobotoMono/font.css';
import './style.css';
ReactDOM.render(
-
-
-
-
-
-
-
- ,
+
+
+
+
+
+
+
+
+
+ ,
document.querySelector('#container')
);
+
+if (module.hot) {
+ module.hot.accept('./tokendeploy/Application/index.js', () => {
+ require('./tokendeploy/Application/index.js');
+ require('./tokendeploy/Overview/index.js');
+ require('./tokendeploy/Transfer/index.js');
+
+ ReactDOM.render(
+
+
+
+
+
+
+
+
+
+ ,
+ document.querySelector('#container')
+ );
+ });
+}
diff --git a/js/src/dapps/tokendeploy/services.js b/js/src/dapps/tokendeploy/services.js
index 9ca4c4f5650..6cfeff05f76 100644
--- a/js/src/dapps/tokendeploy/services.js
+++ b/js/src/dapps/tokendeploy/services.js
@@ -119,7 +119,7 @@ export function attachInstances () {
.all([
api.parity.registryAddress(),
api.parity.netChain(),
- api.partiy.netVersion()
+ api.net.version()
])
.then(([registryAddress, netChain, _netVersion]) => {
const registry = api.newContract(abis.registry, registryAddress).instance;
diff --git a/js/src/dapps/tokenreg.js b/js/src/dapps/tokenreg.js
index 5c6bb4bd1ec..3e8dc9b1942 100644
--- a/js/src/dapps/tokenreg.js
+++ b/js/src/dapps/tokenreg.js
@@ -17,6 +17,7 @@
import ReactDOM from 'react-dom';
import React from 'react';
import { Provider } from 'react-redux';
+import { AppContainer } from 'react-hot-loader';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
@@ -29,10 +30,25 @@ import '../../assets/fonts/RobotoMono/font.css';
import './style.css';
ReactDOM.render(
- (
+
- ),
+ ,
document.querySelector('#container')
);
+
+if (module.hot) {
+ module.hot.accept('./tokenreg/Container.js', () => {
+ require('./tokenreg/Container.js');
+
+ ReactDOM.render(
+
+
+
+
+ ,
+ document.querySelector('#container')
+ );
+ });
+}
diff --git a/js/src/modals/DeployContract/deployContract.js b/js/src/modals/DeployContract/deployContract.js
index 14930d312ba..802de64fb50 100644
--- a/js/src/modals/DeployContract/deployContract.js
+++ b/js/src/modals/DeployContract/deployContract.js
@@ -142,12 +142,13 @@ class DeployContract extends Component {
render () {
const { step, deployError, rejected, inputs } = this.state;
- const realStep = Object.keys(STEPS).findIndex((k) => k === step);
- const realSteps = deployError || rejected
- ? null
- : Object.keys(STEPS)
- .filter((k) => k !== 'CONTRACT_PARAMETERS' || inputs.length > 0)
- .map((k) => STEPS[k]);
+ const realStepKeys = deployError || rejected
+ ? []
+ : Object.keys(STEPS).filter((k) => k !== 'CONTRACT_PARAMETERS' || inputs.length > 0);
+ const realStep = realStepKeys.findIndex((k) => k === step);
+ const realSteps = realStepKeys.length
+ ? realStepKeys.map((k) => STEPS[k])
+ : null;
const title = realSteps
? null
diff --git a/js/src/ui/Form/Input/input.js b/js/src/ui/Form/Input/input.js
index 44906ad93ff..64ec544b9b5 100644
--- a/js/src/ui/Form/Input/input.js
+++ b/js/src/ui/Form/Input/input.js
@@ -214,6 +214,7 @@ export default class Input extends Component {
onChange = (event, value) => {
event.persist();
+
this.setValue(value, () => {
this.props.onChange && this.props.onChange(event, value);
});
@@ -231,12 +232,10 @@ export default class Input extends Component {
}
onPaste = (event) => {
- const { value } = event.target;
- const pasted = event.clipboardData.getData('Text');
-
+ // Wait for the onChange handler to be called
window.setTimeout(() => {
- this.onSubmit(value + pasted);
- }, 0);
+ this.onSubmit(this.state.value);
+ }, 200);
}
onKeyDown = (event) => {
diff --git a/js/src/ui/MethodDecoding/methodDecodingStore.js b/js/src/ui/MethodDecoding/methodDecodingStore.js
index 05a8f8546a3..1b8671465cf 100644
--- a/js/src/ui/MethodDecoding/methodDecodingStore.js
+++ b/js/src/ui/MethodDecoding/methodDecodingStore.js
@@ -138,6 +138,10 @@ export default class MethodDecodingStore {
return Promise.resolve(result);
}
+ if (!transaction.to) {
+ return this.decodeContractCreation(result);
+ }
+
let signature;
try {
@@ -206,7 +210,7 @@ export default class MethodDecodingStore {
});
}
- decodeContractCreation (data, contractAddress) {
+ decodeContractCreation (data, contractAddress = '') {
const result = {
...data,
contract: true,