aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/assets
diff options
context:
space:
mode:
Diffstat (limited to 'ethereal/assets')
-rw-r--r--ethereal/assets/debugger/debugger.qml14
-rw-r--r--ethereal/assets/ext/ethereum.js3
-rw-r--r--ethereal/assets/qml/QmlApp.qml22
-rw-r--r--ethereal/assets/qml/test_app.qml81
-rw-r--r--ethereal/assets/qml/wallet.qml14
-rw-r--r--ethereal/assets/qml/webapp.qml6
6 files changed, 110 insertions, 30 deletions
diff --git a/ethereal/assets/debugger/debugger.qml b/ethereal/assets/debugger/debugger.qml
index 31e0eb781..3e653882c 100644
--- a/ethereal/assets/debugger/debugger.qml
+++ b/ethereal/assets/debugger/debugger.qml
@@ -10,9 +10,9 @@ ApplicationWindow {
visible: false
title: "IceCREAM"
minimumWidth: 1280
- minimumHeight: 900
+ minimumHeight: 700
width: 1290
- height: 900
+ height: 700
property alias codeText: codeEditor.text
property alias dataText: rawDataField.text
@@ -42,7 +42,7 @@ ApplicationWindow {
TableView {
id: asmTableView
width: 200
- TableViewColumn{ role: "value" ; title: "" ; width: 100 }
+ TableViewColumn{ role: "value" ; title: "" ; width: 200 }
model: asmModel
}
@@ -56,7 +56,7 @@ ApplicationWindow {
Rectangle {
color: "#00000000"
- height: 500
+ height: 330
anchors.left: parent.left
anchors.right: parent.right
@@ -208,6 +208,12 @@ ApplicationWindow {
}
text: "Next"
}
+ CheckBox {
+ id: breakEachLine
+ objectName: "breakEachLine"
+ text: "Break each instruction"
+ checked: true
+ }
}
}
diff --git a/ethereal/assets/ext/ethereum.js b/ethereal/assets/ext/ethereum.js
index c58fe24c2..de6fb0255 100644
--- a/ethereal/assets/ext/ethereum.js
+++ b/ethereal/assets/ext/ethereum.js
@@ -58,6 +58,9 @@ window.eth = {
getBalanceAt: function(address, cb) {
postData({call: "getBalance", args: [address]}, cb);
},
+ getTransactionsFor: function(address, cb) {
+ postData({call: "getTransactionsFor", args: [address]}, cb);
+ },
getSecretToAddress: function(sec, cb) {
postData({call: "getSecretToAddress", args: [sec]}, cb);
diff --git a/ethereal/assets/qml/QmlApp.qml b/ethereal/assets/qml/QmlApp.qml
new file mode 100644
index 000000000..f5c503f4c
--- /dev/null
+++ b/ethereal/assets/qml/QmlApp.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.0;
+import QtQuick.Layouts 1.0;
+import Ethereum 1.0
+
+ApplicationWindow {
+ minimumWidth: 500
+ maximumWidth: 500
+ maximumHeight: 400
+ minimumHeight: 400
+
+ function onNewBlockCb(block) {
+ console.log("Please overwrite onNewBlock(block):", block)
+ }
+ function onObjectChangeCb(stateObject) {
+ console.log("Please overwrite onObjectChangeCb(object)", stateObject)
+ }
+ function onStorageChangeCb(storageObject) {
+ var ev = ["storage", storageObject.stateAddress, storageObject.address].join(":");
+ console.log("Please overwrite onStorageChangeCb(object)", ev)
+ }
+}
diff --git a/ethereal/assets/qml/test_app.qml b/ethereal/assets/qml/test_app.qml
index aace4e881..c69587839 100644
--- a/ethereal/assets/qml/test_app.qml
+++ b/ethereal/assets/qml/test_app.qml
@@ -3,33 +3,68 @@ import QtQuick.Controls 1.0;
import QtQuick.Layouts 1.0;
import Ethereum 1.0
-ApplicationWindow {
- minimumWidth: 500
- maximumWidth: 500
- maximumHeight: 100
- minimumHeight: 100
+QmlApp {
+ minimumWidth: 350
+ maximumWidth: 350
+ maximumHeight: 80
+ minimumHeight: 80
- title: "Ethereum Dice"
+ title: "Generic Coin"
- TextField {
- id: textField
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- placeholderText: "Amount"
+ property string contractAddr: "f299f6c74515620e4c4cd8fe3d205b5c4f2e25c8"
+ property string addr: "2ef47100e0787b915105fd5e3f4ff6752079d5cb"
+
+ Component.onCompleted: {
+ eth.watch(contractAddr, addr)
+ eth.watch(addr, contractAddr)
+ setAmount()
+ }
+
+ function onStorageChangeCb(storageObject) {
+ setAmount()
}
- Label {
- id: txHash
- anchors.bottom: textField.top
- anchors.bottomMargin: 5
- anchors.horizontalCenter: parent.horizontalCenter
+
+ function setAmount(){
+ var state = eth.getStateObject(contractAddr)
+ var storage = state.getStorage(addr)
+ amountLabel.text = storage
}
- Button {
- anchors.top: textField.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 5
- text: "Place bet"
- onClicked: {
- txHash.text = eth.createTx("e6716f9544a56c530d868e4bfbacb172315bdead", textField.text)
+ Column {
+ spacing: 5
+ Row {
+ spacing: 20
+ Label {
+ id: genLabel
+ text: "Generic coin balance:"
+ }
+ Label {
+ id: amountLabel
+ }
+ }
+ Row {
+ spacing: 20
+ TextField {
+ id: address
+ placeholderText: "Address"
+ }
+ TextField {
+ id: amount
+ placeholderText: "Amount"
+ }
+ }
+ Button {
+ text: "Send coins"
+ onClicked: {
+ var privKey = eth.getKey().privateKey
+ if(privKey){
+ var result = eth.transact(privKey, contractAddr, 0,"100000","250", "0x" + address.text + "\n" + amount.text)
+ resultTx.text = result.hash
+ }
+ }
+ }
+ Label {
+ id: resultTx
}
}
+
}
diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml
index a7c03f6d1..84f8fd5cf 100644
--- a/ethereal/assets/qml/wallet.qml
+++ b/ethereal/assets/qml/wallet.qml
@@ -319,7 +319,7 @@ ApplicationWindow {
Slider {
id: logLevelSlider
- value: 1
+ value: eth.getLogLevelInt()
anchors {
right: parent.right
top: parent.top
@@ -332,7 +332,7 @@ ApplicationWindow {
}
orientation: Qt.Vertical
- maximumValue: 3
+ maximumValue: 5
stepSize: 1
onValueChanged: {
@@ -372,7 +372,15 @@ ApplicationWindow {
onAccepted: {
//ui.open(openAppDialog.fileUrl.toString())
//ui.openHtml(Qt.resolvedUrl(ui.assetPath("test.html")))
- ui.openHtml(openAppDialog.fileUrl.toString())
+ var path = openAppDialog.fileUrl.toString()
+ console.log(path)
+ var ext = path.split('.').pop()
+ console.log(ext)
+ if(ext == "html" || ext == "htm") {
+ ui.openHtml(path)
+ }else if(ext == "qml"){
+ ui.openQml(path)
+ }
}
}
diff --git a/ethereal/assets/qml/webapp.qml b/ethereal/assets/qml/webapp.qml
index 4a5a1293a..63927f0eb 100644
--- a/ethereal/assets/qml/webapp.qml
+++ b/ethereal/assets/qml/webapp.qml
@@ -103,6 +103,12 @@ ApplicationWindow {
postData(data._seed,stateObject)
break
+ case "getTransactionsFor":
+ require(1);
+ var txs = eth.getTransactionsFor(data.args[0], true)
+ postData(data._seed, txs)
+
+ break
case "getBalance":
require(1);