diff options
author | Alexandre Van de Sande <alex.vandesande@ethdev.com> | 2015-02-23 20:05:15 +0800 |
---|---|---|
committer | Alexandre Van de Sande <alex.vandesande@ethdev.com> | 2015-02-23 20:05:15 +0800 |
commit | dea65840186fe861017524c9cb59ae07ac97ed06 (patch) | |
tree | 5cb5e339b9ce77a2a3c92cf8a10c4294fcf7965c /cmd/mist/assets | |
parent | bb3338df6363d8267a24190584f0908463241a6c (diff) | |
parent | dd086791acf477da7641c168f82de70ed0b2dca6 (diff) | |
download | go-tangerine-dea65840186fe861017524c9cb59ae07ac97ed06.tar.gz go-tangerine-dea65840186fe861017524c9cb59ae07ac97ed06.tar.zst go-tangerine-dea65840186fe861017524c9cb59ae07ac97ed06.zip |
Merge branch 'develop' into ui
Diffstat (limited to 'cmd/mist/assets')
-rw-r--r-- | cmd/mist/assets/examples/bomb.html | 22 | ||||
-rw-r--r-- | cmd/mist/assets/examples/coin.html | 28 | ||||
-rw-r--r-- | cmd/mist/assets/examples/info.html | 4 | ||||
-rw-r--r-- | cmd/mist/assets/ext/ethereum.js/dist/ethereum.js | 2 | ||||
-rw-r--r-- | cmd/mist/assets/qml/main.qml | 8 | ||||
-rw-r--r-- | cmd/mist/assets/qml/views/pending_tx.qml | 9 |
6 files changed, 53 insertions, 20 deletions
diff --git a/cmd/mist/assets/examples/bomb.html b/cmd/mist/assets/examples/bomb.html new file mode 100644 index 000000000..62540f9bb --- /dev/null +++ b/cmd/mist/assets/examples/bomb.html @@ -0,0 +1,22 @@ +<html> +<head> +<script src="../ext/bignumber.min.js"></script> +<script src="../ext/ethereum.js/dist/ethereum.js"></script> + +<script> +var web3 = require('web3'); +web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8545')); +var eth = web3.eth; + +function bomb() { + for (var i = 0; i < 200; i++) { + eth.transact({}) + } +} +</script> +</head> + +<body> +<button onclick="bomb();">BOOM!</button> +</body> +</html> diff --git a/cmd/mist/assets/examples/coin.html b/cmd/mist/assets/examples/coin.html index ca7a9c0dd..18a6811d7 100644 --- a/cmd/mist/assets/examples/coin.html +++ b/cmd/mist/assets/examples/coin.html @@ -14,8 +14,9 @@ </div> <div> - <span class="amount">Amount:</span> + <span>Address:</span> <input type="text" id="address" style="width:200px"> + <span>Amount:</span> <input type="text" id="amount" style="width:200px"> <button onclick="transact()">Send</button> </div> @@ -58,7 +59,7 @@ }], "outputs": [] }, { - "name":"received", + "name":"Changed", "type":"event", "inputs": [ {"name":"from","type":"address","indexed":true}, @@ -69,23 +70,14 @@ var address = localStorage.getItem("address"); // deploy if not exist if (address == null) { - var code = "0x60056013565b61012b806100346000396000f35b6103e8600033600160a060020a0316600052602052604060002081905550560060e060020a6000350480637bb98a681461002b578063d0679d3414610039578063e3d670d71461004d57005b610033610126565b60006000f35b610047600435602435610062565b60006000f35b610058600435610104565b8060005260206000f35b80600033600160a060020a0316600052602052604060002054101561008657610100565b80600033600160a060020a0316600052602052604060002090815403908190555080600083600160a060020a0316600052602052604060002090815401908190555033600160a060020a0316600052806020527ff11e547d796cc64acdf758e7cee90439494fd886a19159454aa61e473fdbafef60406000a15b5050565b6000600082600160a060020a03166000526020526040600020549050919050565b5b60008156"; + var code = "0x60056013565b61014f8061003a6000396000f35b620f42406000600033600160a060020a0316815260200190815260200160002081905550560060e060020a600035048063d0679d3414610020578063e3d670d71461003457005b61002e600435602435610049565b60006000f35b61003f600435610129565b8060005260206000f35b806000600033600160a060020a03168152602001908152602001600020541061007157610076565b610125565b806000600033600160a060020a03168152602001908152602001600020908154039081905550806000600084600160a060020a031681526020019081526020016000209081540190819055508033600160a060020a03167fb52dda022b6c1a1f40905a85f257f689aa5d69d850e49cf939d688fbe5af594660006000a38082600160a060020a03167fb52dda022b6c1a1f40905a85f257f689aa5d69d850e49cf939d688fbe5af594660006000a35b5050565b60006000600083600160a060020a0316815260200190815260200160002054905091905056"; address = web3.eth.transact({data: code}); localStorage.setItem("address", address); } - document.querySelector("#contract_addr").innerHTML = address.toUpperCase(); + document.querySelector("#contract_addr").innerHTML = address; var contract = web3.eth.contract(address, desc); - contract.received({from: eth.coinbase}).changed(function() { - refresh(); - }); - - var ev = contract.SingleTransact({}) - ev.watch(function(log) { - someElement.innerHTML += "tnaheousnthaoeu"; - }); - - eth.watch('chain').changed(function() { + contract.Changed({from: eth.coinbase}).changed(function() { refresh(); }); @@ -98,7 +90,7 @@ var storage = eth.storageAt(address); table.innerHTML = ""; for( var item in storage ) { - table.innerHTML += "<tr><td>"+item.toUpperCase()+"</td><td>"+web3.toDecimal(storage[item])+"</td></tr>"; + table.innerHTML += "<tr><td>"+item+"</td><td>"+web3.toDecimal(storage[item])+"</td></tr>"; } } @@ -111,6 +103,7 @@ } var value = parseInt( document.querySelector("#amount").value ); + console.log("transact: ", to, " => ", value) contract.send( to, value ); } @@ -126,7 +119,7 @@ contract JevCoin { balances[msg.sender] = 1000000; } - event changed(address indexed from, address indexed to); + event Changed(address indexed from, uint indexed amount); function send(address to, uint value) { if( balances[msg.sender] < value ) return; @@ -134,7 +127,8 @@ contract JevCoin { balances[msg.sender] -= value; balances[to] += value; - changed(msg.sender, to); + Changed(msg.sender, value); + Changed(to, value); } function balance(address who) constant returns(uint t) diff --git a/cmd/mist/assets/examples/info.html b/cmd/mist/assets/examples/info.html index d8816b19f..2a405c280 100644 --- a/cmd/mist/assets/examples/info.html +++ b/cmd/mist/assets/examples/info.html @@ -71,6 +71,10 @@ document.querySelector("#gas_price").innerHTML = eth.gasPrice; document.querySelector("#mining").innerHTML = eth.mining; document.querySelector("#listening").innerHTML = eth.listening; + eth.watch('chain').changed(function() { + document.querySelector("#number").innerHTML = eth.number; + }); + </script> </html> diff --git a/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js b/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js index d0e9d3cb7..83b598b3f 100644 --- a/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js +++ b/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js @@ -1417,6 +1417,8 @@ var ethMethods = function () { var methods = [ { name: 'balanceAt', call: 'eth_balanceAt' }, + { name: 'register', call: 'eth_register' }, + { name: 'unregister', call: 'eth_unregister' }, { name: 'stateAt', call: 'eth_stateAt' }, { name: 'storageAt', call: 'eth_storageAt' }, { name: 'countAt', call: 'eth_countAt'}, diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 3c5772d84..1f7fcbec6 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -256,6 +256,7 @@ ApplicationWindow { } } } + } property var blockModel: ListModel { @@ -895,7 +896,7 @@ ApplicationWindow { } function setWalletValue(value) { - walletValueLabel.text = value + //walletValueLabel.text = value } function loadPlugin(name) { @@ -947,7 +948,8 @@ ApplicationWindow { model: peerModel TableViewColumn{width: 180; role: "addr" ; title: "Remote Address" } TableViewColumn{width: 280; role: "nodeID" ; title: "Node ID" } - TableViewColumn{width: 180; role: "caps" ; title: "Capabilities" } + TableViewColumn{width: 100; role: "name" ; title: "Name" } + TableViewColumn{width: 40; role: "caps" ; title: "Capabilities" } } } } @@ -978,7 +980,7 @@ ApplicationWindow { anchors.top: parent.top anchors.topMargin: 30 font.pointSize: 12 - text: "<h2>Mist (0.7.10)</h2><br><h3>Development</h3>Jeffrey Wilcke<br>Viktor Trón<br>Felix Lange<br>Taylor Gerring<br>Daniel Nagy<br><h3>UX</h3>Alex van de Sande<br>" + text: "<h2>Mist (0.8.5)</h2><br><h3>Development</h3>Jeffrey Wilcke<br>Viktor Trón<br>Felix Lange<br>Taylor Gerring<br>Daniel Nagy<br>Gustav Simonsson<br><h3>UX/UI</h3>Alex van de Sande<br>Fabian Vogelsteller" } } diff --git a/cmd/mist/assets/qml/views/pending_tx.qml b/cmd/mist/assets/qml/views/pending_tx.qml index 4442a69db..3dcedeff2 100644 --- a/cmd/mist/assets/qml/views/pending_tx.qml +++ b/cmd/mist/assets/qml/views/pending_tx.qml @@ -41,4 +41,13 @@ Rectangle { pendingTxModel.insert(0, {hash: tx.hash, to: tx.address, from: tx.sender, value: tx.value, contract: isContract}) } + + function removeTx(tx) { + for (var i = 0; i < pendingTxModel.count; i++) { + if (tx.hash === pendingTxModel.get(i).hash) { + pendingTxModel.remove(i); + break; + } + } + } } |