Commit 9b65a27b authored by yann300's avatar yann300

remix version number

parent 8007573b
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"webworkify": "^1.2.1", "webworkify": "^1.2.1",
"yo-yo": "^1.2.2", "yo-yo": "^1.2.2",
"yo-yoify": "^3.3.0", "yo-yoify": "^3.3.0",
"ethereum-remix": "0.0.2-alpha.0.0.4" "ethereum-remix": "0.0.2-alpha.0.0.7"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
...@@ -19,7 +19,6 @@ function UniversalDApp (contracts, options, transactionDebugger) { ...@@ -19,7 +19,6 @@ function UniversalDApp (contracts, options, transactionDebugger) {
self.web3 = options.web3; self.web3 = options.web3;
self.transactionDebugger = transactionDebugger; self.transactionDebugger = transactionDebugger;
transactionDebugger.addProvider('EXTERNAL', self.web3); transactionDebugger.addProvider('EXTERNAL', self.web3);
transactionDebugger.switchProvider('EXTERNAL')
if (options.mode === 'vm') { if (options.mode === 'vm') {
// FIXME: use `options.vm` or `self.vm` consistently // FIXME: use `options.vm` or `self.vm` consistently
options.vm = true; options.vm = true;
...@@ -28,7 +27,6 @@ function UniversalDApp (contracts, options, transactionDebugger) { ...@@ -28,7 +27,6 @@ function UniversalDApp (contracts, options, transactionDebugger) {
self.vm = new EthJSVM(null, null, { activatePrecompiles: true, enableHomestead: true }); self.vm = new EthJSVM(null, null, { activatePrecompiles: true, enableHomestead: true });
transactionDebugger.addProvider('VM', self.vm); transactionDebugger.addProvider('VM', self.vm);
transactionDebugger.switchProvider('VM')
self.addAccount('3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511'); self.addAccount('3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511');
self.addAccount('2ac6c190b09897cd8987869cc7b918cfea07ee82038d492abce033c75c1b1d0c'); self.addAccount('2ac6c190b09897cd8987869cc7b918cfea07ee82038d492abce033c75c1b1d0c');
} else if (options.mode !== 'web3') { } else if (options.mode !== 'web3') {
...@@ -365,6 +363,16 @@ UniversalDApp.prototype.getCallButton = function (args) { ...@@ -365,6 +363,16 @@ UniversalDApp.prototype.getCallButton = function (args) {
return $debugTx; return $debugTx;
}; };
var getDebugCall = function (result) {
var $debugTx = $('<div class="debugCall">');
var $button = $('<button class="debug">Debug Call</button>');
$button.click(function () {
self.transactionDebugger.debug(result);
});
$debugTx.append($button);
return $debugTx;
};
var getGasUsedOutput = function (result, vmResult) { var getGasUsedOutput = function (result, vmResult) {
var $gasUsed = $('<div class="gasUsed">'); var $gasUsed = $('<div class="gasUsed">');
var caveat = lookupOnly ? '<em>(<span class="caveat" title="Cost only applies when called by a contract">caveat</span>)</em>' : ''; var caveat = lookupOnly ? '<em>(<span class="caveat" title="Cost only applies when called by a contract">caveat</span>)</em>' : '';
...@@ -517,7 +525,11 @@ UniversalDApp.prototype.getCallButton = function (args) { ...@@ -517,7 +525,11 @@ UniversalDApp.prototype.getCallButton = function (args) {
if (decoded) { if (decoded) {
$result.append(decoded); $result.append(decoded);
} }
$result.append(getDebugTransaction(result)); if (args.abi.constant) {
$result.append(getDebugCall(result));
} else {
$result.append(getDebugTransaction(result));
}
} else if (args.abi.constant && !isConstructor) { } else if (args.abi.constant && !isConstructor) {
clearOutput($result); clearOutput($result);
$result.append(getReturnOutput(result)).append(getGasUsedOutput({})); $result.append(getReturnOutput(result)).append(getGasUsedOutput({}));
...@@ -654,6 +666,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) { ...@@ -654,6 +666,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
var tx; var tx;
if (!self.vm) { if (!self.vm) {
self.transactionDebugger.switchProvider('EXTERNAL');
tx = { tx = {
from: self.options.getAddress ? self.options.getAddress() : self.web3.eth.accounts[0], from: self.options.getAddress ? self.options.getAddress() : self.web3.eth.accounts[0],
to: to, to: to,
...@@ -686,6 +699,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) { ...@@ -686,6 +699,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
} }
} else { } else {
try { try {
self.transactionDebugger.switchProvider('VM');
var address = self.options.getAddress ? self.options.getAddress() : self.getAccounts()[0]; var address = self.options.getAddress ? self.options.getAddress() : self.getAccounts()[0];
var account = self.accounts[address]; var account = self.accounts[address];
tx = new EthJSTX({ tx = new EthJSTX({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment