diff options
author | Maran <maran.hidskes@gmail.com> | 2014-04-12 05:05:02 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-04-12 05:05:02 +0800 |
commit | ab8d96258ea11c828a149dde176fe8e2efce0294 (patch) | |
tree | cd810367355f4e4a9e77700ffe2b7358004788e2 | |
parent | 3f82d5172f372b5f5d8d9ede4967c5d2b9867980 (diff) | |
download | dexon-ab8d96258ea11c828a149dde176fe8e2efce0294.tar.gz dexon-ab8d96258ea11c828a149dde176fe8e2efce0294.tar.zst dexon-ab8d96258ea11c828a149dde176fe8e2efce0294.zip |
Added isContract to gui
-rw-r--r-- | ethereal/assets/qml/wallet.qml | 9 | ||||
-rw-r--r-- | ethereal/ui/gui.go | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index 95512f661..0c8c91e13 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -140,6 +140,7 @@ ApplicationWindow { anchors.fill: parent TableViewColumn{ role: "value" ; title: "Value" ; width: 100 } TableViewColumn{ role: "address" ; title: "Address" ; width: 430 } + TableViewColumn{ role: "contract" ; title: "Contract" ; width: 100 } model: txModel } @@ -448,7 +449,13 @@ ApplicationWindow { } function addTx(tx) { - txModel.insert(0, {hash: tx.hash, address: tx.address, value: tx.value}) + var isContract + if (tx.contract == true){ + isContract = "Yes" + }else{ + isContract = "No" + } + txModel.insert(0, {hash: tx.hash, address: tx.address, value: tx.value, contract: isContract}) } function addBlock(block) { diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index fa4a5c833..c09c5954f 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -21,13 +21,15 @@ type Block struct { type Tx struct { Value, Hash, Address string + Contract bool } func NewTxFromTransaction(tx *ethchain.Transaction) *Tx { hash := hex.EncodeToString(tx.Hash()) sender := hex.EncodeToString(tx.Recipient) + isContract := len(tx.Data) > 0 - return &Tx{Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: sender} + return &Tx{Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: sender, Contract: isContract} } // Creates a new QML Block from a chain block |