diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-01 19:45:39 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-01 19:45:39 +0800 |
commit | 253c23240b8cec56e2bb21072291e2f7ef1a49e9 (patch) | |
tree | 64503d09f1120ef2327a8184e46d5ee8bc7090bd /ethereal/assets/qml/test_app.qml | |
parent | 0ce9003ba77c0552c9058caa55d2fea6711ac18c (diff) | |
parent | 098f7f23ce62d3f0c60d30d325576de93795cc4b (diff) | |
download | go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.tar go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.tar.gz go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.tar.bz2 go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.tar.lz go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.tar.xz go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.tar.zst go-tangerine-253c23240b8cec56e2bb21072291e2f7ef1a49e9.zip |
Merge branch 'feature/keys' of https://github.com/ethersphere/go-ethereum into ethersphere-feature/keys
Conflicts:
.gitignore
README.md
Diffstat (limited to 'ethereal/assets/qml/test_app.qml')
-rw-r--r-- | ethereal/assets/qml/test_app.qml | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/ethereal/assets/qml/test_app.qml b/ethereal/assets/qml/test_app.qml new file mode 100644 index 000000000..c69587839 --- /dev/null +++ b/ethereal/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 + } + } + +} |