aboutsummaryrefslogtreecommitdiffstats
path: root/mist/assets/qml/test_app.qml
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-19 19:33:15 +0800
committerobscuren <geffobscura@gmail.com>2014-09-19 19:34:37 +0800
commitae1de6593c31fbaa4429588cea2702dd5b01a722 (patch)
treed19c960d08524f0c5449ba87ab7ef4054b782b32 /mist/assets/qml/test_app.qml
parent723074e71bbe1638a5cec9b996b1eed07a76fd72 (diff)
downloadgo-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.gz
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.bz2
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.lz
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.xz
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.tar.zst
go-tangerine-ae1de6593c31fbaa4429588cea2702dd5b01a722.zip
renamed
Diffstat (limited to 'mist/assets/qml/test_app.qml')
-rw-r--r--mist/assets/qml/test_app.qml70
1 files changed, 70 insertions, 0 deletions
diff --git a/mist/assets/qml/test_app.qml b/mist/assets/qml/test_app.qml
new file mode 100644
index 000000000..c69587839
--- /dev/null
+++ b/mist/assets/qml/test_app.qml
@@ -0,0 +1,70 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.0;
+import QtQuick.Layouts 1.0;
+import Ethereum 1.0
+
+QmlApp {
+ minimumWidth: 350
+ maximumWidth: 350
+ maximumHeight: 80
+ minimumHeight: 80
+
+ title: "Generic Coin"
+
+ property string contractAddr: "f299f6c74515620e4c4cd8fe3d205b5c4f2e25c8"
+ property string addr: "2ef47100e0787b915105fd5e3f4ff6752079d5cb"
+
+ Component.onCompleted: {
+ eth.watch(contractAddr, addr)
+ eth.watch(addr, contractAddr)
+ setAmount()
+ }
+
+ function onStorageChangeCb(storageObject) {
+ setAmount()
+ }
+
+ function setAmount(){
+ var state = eth.getStateObject(contractAddr)
+ var storage = state.getStorage(addr)
+ amountLabel.text = storage
+ }
+ 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
+ }
+ }
+
+}