Commit f48306ca authored by Alex Beregszaszi's avatar Alex Beregszaszi

Move web3.eth.getAccounts into udapp

parent e35a3a67
......@@ -890,11 +890,7 @@ $(document).ready(function() {
} else $txOrigin.val('unknown');
}
if (executionContext === 'vm') {
dapp.getAccounts(renderAccounts);
} else {
web3.eth.getAccounts(renderAccounts);
}
dapp.getAccounts(renderAccounts);
$contractOutput.find('.title').click(function(ev){ $(this).closest('.contract').toggleClass('hide'); });
$('#output').append( $contractOutput );
......@@ -994,4 +990,4 @@ $(document).ready(function() {
syncStorage()
});
\ No newline at end of file
});
......@@ -38,9 +38,13 @@ UniversalDApp.prototype.addAccount = function (privateKey, balance) {
};
UniversalDApp.prototype.getAccounts = function (cb) {
if (!this.accounts) return cb("No accounts?");
if (!this.vm) {
web3.eth.getAccounts(cb);
} else {
if (!this.accounts) return cb("No accounts?");
cb(null, Object.keys(this.accounts));
cb(null, Object.keys(this.accounts));
}
};
UniversalDApp.prototype.render = function () {
......
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