Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
bd95fd770b | |||
2b8eae9810 | |||
b2dc19155f | |||
7a5b279459 | |||
cf999c4622 | |||
dc944f7518 | |||
d5d1e50365 | |||
29f5dd38e3 | |||
b8b1453392 | |||
1cb12296f6 | |||
96fd1ce270 | |||
6ecbbe4006 | |||
acfb5b85fb | |||
70db149494 | |||
a4007f3b68 | |||
353b558536 | |||
8516e748ca | |||
8780deece9 | |||
9ac4e23b66 |
@ -7,7 +7,7 @@ Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ether
|
||||
|
||||
Ethereum Go Client © 2014 Jeffrey Wilcke.
|
||||
|
||||
Current state: Proof of Concept 0.6.5.
|
||||
Current state: Proof of Concept 0.6.7.
|
||||
|
||||
For the development package please see the [eth-go package](https://github.com/ethereum/eth-go).
|
||||
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
|
||||
const (
|
||||
ClientIdentifier = "Ethereum(G)"
|
||||
Version = "0.6.5"
|
||||
Version = "0.6.7"
|
||||
)
|
||||
|
||||
var logger = ethlog.NewLogger("CLI")
|
||||
|
@ -357,7 +357,7 @@ ApplicationWindow {
|
||||
anchors.right: parent.right
|
||||
model: ListModel {
|
||||
ListElement { text: "Snippets" ; value: "" }
|
||||
ListElement { text: "Call Contract" ; value: "var[2] in;\nvar ret;\n\nin[0] = \"arg1\"\nin[1] = 0xdeadbeef\n\nvar success = call(0x0c542ddea93dae0c2fcb2cf175f03ad80d6be9a0, 0, 7000, in, ret)\n\nreturn ret" }
|
||||
ListElement { text: "Call Contract" ; value: "var[2] in = { \"arg1\", 0xdeadbeef };\nvar ret;\n\nvar success = call(0x0c542ddea93dae0c2fcb2cf175f03ad80d6be9a0, 0, 7000, in, ret)\n\nreturn ret" }
|
||||
}
|
||||
onCurrentIndexChanged: {
|
||||
if(currentIndex != 0) {
|
||||
|
@ -92,19 +92,19 @@
|
||||
promises.push(params.from.then(function(_from) { params.from = _from; }));
|
||||
}
|
||||
|
||||
if(isPromise(params.data)) {
|
||||
promises.push(params.data.then(function(_code) { params.data = _code; }));
|
||||
} else {
|
||||
if(typeof params.data === "object") {
|
||||
data = "";
|
||||
for(var i = 0; i < params.data.length; i++) {
|
||||
data += params.data[i]
|
||||
}
|
||||
} else {
|
||||
data = params.data;
|
||||
}
|
||||
}
|
||||
if(typeof params.data !== "object" || isPromise(params.data)) {
|
||||
params.data = [params.data]
|
||||
}
|
||||
|
||||
var data = params.data;
|
||||
for(var i = 0; i < params.data.length; i++) {
|
||||
if(isPromise(params.data[i])) {
|
||||
var promise = params.data[i];
|
||||
var _i = i;
|
||||
promises.push(promise.then(function(_arg) { params.data[_i] = _arg; }));
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure everything is string
|
||||
var fields = ["value", "gas", "gasPrice"];
|
||||
for(var i = 0; i < fields.length; i++) {
|
||||
@ -117,6 +117,7 @@
|
||||
// Load promises then call the last "transact".
|
||||
return Q.all(promises).then(function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
params.data = params.data.join("");
|
||||
postData({call: "transact", args: params}, function(data) {
|
||||
if(data[1])
|
||||
reject(data[0]);
|
||||
@ -335,7 +336,7 @@
|
||||
|
||||
Object.defineProperty(eth, "gasPrice", {
|
||||
get: function() {
|
||||
return "1000000000000"
|
||||
return "10000000000000"
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -14,7 +14,7 @@ ApplicationWindow {
|
||||
|
||||
property alias miningButtonText: miningButton.text
|
||||
property var ethx : Eth.ethx
|
||||
property var web
|
||||
property var browser
|
||||
|
||||
width: 1200
|
||||
height: 820
|
||||
@ -29,7 +29,7 @@ ApplicationWindow {
|
||||
//var messages = JSON.parse(data)
|
||||
// Signal handler
|
||||
messages(data, receiverSeed);
|
||||
root.web.messages(data, receiverSeed);
|
||||
root.browser.view.messages(data, receiverSeed);
|
||||
}
|
||||
|
||||
TextField {
|
||||
@ -47,7 +47,7 @@ ApplicationWindow {
|
||||
Component.onCompleted: {
|
||||
var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum", active: true});
|
||||
var browser = addPlugin("./webapp.qml", {noAdd: true, close: false, section: "ethereum", active: true});
|
||||
root.web = browser.view;
|
||||
root.browser = browser;
|
||||
|
||||
addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"});
|
||||
addPlugin("./views/chain.qml", {noAdd: true, close: false, section: "legacy"});
|
||||
@ -254,6 +254,7 @@ ApplicationWindow {
|
||||
|
||||
statusBar: StatusBar {
|
||||
height: 32
|
||||
id: statusBar
|
||||
RowLayout {
|
||||
Button {
|
||||
id: miningButton
|
||||
@ -294,16 +295,16 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
ProgressBar {
|
||||
id: syncProgressIndicator
|
||||
visible: false
|
||||
objectName: "syncProgressIndicator"
|
||||
id: downloadIndicator
|
||||
value: 0
|
||||
visible: true
|
||||
objectName: "downloadIndicator"
|
||||
y: 3
|
||||
width: 140
|
||||
indeterminate: true
|
||||
anchors.right: peerGroup.left
|
||||
anchors.rightMargin: 5
|
||||
x: statusBar.width / 2 - this.width / 2
|
||||
width: 160
|
||||
}
|
||||
|
||||
|
||||
RowLayout {
|
||||
id: peerGroup
|
||||
y: 7
|
||||
@ -648,9 +649,12 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
if(this.text == "uuddlrlrba") { gui.toggleTurboMining(); }
|
||||
|
||||
addPlugin(this.text, {close: true, section: "apps"})
|
||||
if(/^https?/.test(this.text)) {
|
||||
root.browser.view.open(this.text);
|
||||
mainSplit.setView(root.browser.view, root.browser.menuItem);
|
||||
} else {
|
||||
addPlugin(this.text, {close: true, section: "apps"})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -735,7 +739,7 @@ ApplicationWindow {
|
||||
|
||||
function addPeer(peer) {
|
||||
// We could just append the whole peer object but it cries if you try to alter them
|
||||
peerModel.append({ip: peer.ip, port: peer.port, lastResponse:timeAgo(peer.lastSend), latency: peer.latency, version: peer.version})
|
||||
peerModel.append({ip: peer.ip, port: peer.port, lastResponse:timeAgo(peer.lastSend), latency: peer.latency, version: peer.version, caps: peer.caps})
|
||||
}
|
||||
|
||||
function resetPeers(){
|
||||
@ -778,10 +782,11 @@ ApplicationWindow {
|
||||
id: peerTable
|
||||
model: peerModel
|
||||
TableViewColumn{width: 100; role: "ip" ; title: "IP" }
|
||||
TableViewColumn{width: 60; role: "port" ; title: "Port" }
|
||||
TableViewColumn{width: 60; role: "port" ; title: "Port" }
|
||||
TableViewColumn{width: 140; role: "lastResponse"; title: "Last event" }
|
||||
TableViewColumn{width: 100; role: "latency"; title: "Latency" }
|
||||
TableViewColumn{width: 260; role: "version" ; title: "Version" }
|
||||
TableViewColumn{width: 80; role: "caps" ; title: "Capabilities" }
|
||||
}
|
||||
}
|
||||
}
|
@ -121,6 +121,23 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
TableView {
|
||||
id: logView
|
||||
headerVisible: false
|
||||
anchors {
|
||||
right: logLevelSlider.left
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
TableViewColumn{ role: "description" ; title: "log" }
|
||||
|
||||
model: logModel
|
||||
}
|
||||
*/
|
||||
|
||||
Slider {
|
||||
id: logLevelSlider
|
||||
value: gui.getLogLevelInt()
|
||||
@ -149,52 +166,6 @@ Rectangle {
|
||||
id: logModel
|
||||
}
|
||||
|
||||
/*
|
||||
RowLayout {
|
||||
id: logLayout
|
||||
width: parent.width
|
||||
height: 200
|
||||
anchors.bottom: parent.bottom
|
||||
TableView {
|
||||
id: logView
|
||||
headerVisible: false
|
||||
anchors {
|
||||
right: logLevelSlider.left
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
TableViewColumn{ role: "description" ; title: "log" }
|
||||
|
||||
model: logModel
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: logLevelSlider
|
||||
value: gui.getLogLevelInt()
|
||||
anchors {
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
|
||||
rightMargin: 5
|
||||
leftMargin: 5
|
||||
topMargin: 5
|
||||
bottomMargin: 5
|
||||
}
|
||||
|
||||
orientation: Qt.Vertical
|
||||
maximumValue: 5
|
||||
stepSize: 1
|
||||
|
||||
onValueChanged: {
|
||||
gui.setLogLevel(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function addDebugMessage(message){
|
||||
debuggerLog.append({value: message})
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ Rectangle {
|
||||
|
||||
var me = eth.key().address;
|
||||
if((to == me|| from == me) && message.input.length == 128) {
|
||||
var to = eth.lookupName(to)
|
||||
var from = eth.lookupName(from)
|
||||
txModel.insert(0, {confirmations: blockNumber - message.number, from: from, to: to, value: value})
|
||||
}
|
||||
}
|
||||
@ -47,9 +49,9 @@ Rectangle {
|
||||
});
|
||||
|
||||
var blockNumber = eth.block(-1).number;
|
||||
var messages = filter.messages()
|
||||
for(var i = messages.length-1; i >= 0; i--) {
|
||||
var message = messages.get(i)
|
||||
var msgs = filter.messages()
|
||||
for(var i = msgs.length-1; i >= 0; i--) {
|
||||
var message = JSON.parse(msgs.getAsJson(i))
|
||||
|
||||
insertTx(message, blockNumber)
|
||||
}
|
||||
@ -151,7 +153,11 @@ Rectangle {
|
||||
Button {
|
||||
text: "Send"
|
||||
onClicked: {
|
||||
eth.transact({from: eth.key().privateKey, to:address, gas: "9000", gasPrice: "100000000000", data: ["0x"+txTo.text, txValue.text]})
|
||||
var lookup = eth.lookupAddress(address)
|
||||
if(lookup.length == 0)
|
||||
lookup = address
|
||||
|
||||
eth.transact({from: eth.key().privateKey, to:lookup, gas: "9000", gasPrice: "10000000000000", data: ["0x"+txTo.text, txValue.text]})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ Rectangle {
|
||||
model: ListModel {
|
||||
id: txModel
|
||||
Component.onCompleted: {
|
||||
var filter = ethx.watch({latest: -1, from: eth.key().address});
|
||||
var filter = ethx.watch({latest: -1, from: eth.key().address});
|
||||
filter.changed(addTxs)
|
||||
|
||||
addTxs(filter.messages())
|
||||
@ -160,7 +160,9 @@ Rectangle {
|
||||
function addTxs(messages) {
|
||||
for(var i = 0; i < messages.length; i++) {
|
||||
var message = messages.get(i);
|
||||
txModel.insert(0, {num: txModel.count, from: message.from, to: message.to, value: eth.numberToHuman(message.value)})
|
||||
var to = eth.lookupName(message.to);
|
||||
var from = eth.lookupName(message.from);
|
||||
txModel.insert(0, {num: txModel.count, from: from, to: to, value: eth.numberToHuman(message.value)})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,48 @@ import "../ext/qml_messaging.js" as Messaging
|
||||
property alias url: webview.url
|
||||
property alias webView: webview
|
||||
|
||||
property var cleanPath: false
|
||||
property var open: function(url) {
|
||||
if(!window.cleanPath) {
|
||||
var uri = url;
|
||||
if(!/.*\:\/\/.*/.test(uri)) {
|
||||
uri = "http://" + uri;
|
||||
}
|
||||
|
||||
var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/
|
||||
|
||||
if(reg.test(uri)) {
|
||||
uri.replace(reg, function(match, pre, domain, path) {
|
||||
uri = pre;
|
||||
|
||||
var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4));
|
||||
var ip = [];
|
||||
for(var i = 0, l = lookup.length; i < l; i++) {
|
||||
ip.push(lookup.charCodeAt(i))
|
||||
}
|
||||
|
||||
if(ip.length != 0) {
|
||||
uri += lookup;
|
||||
} else {
|
||||
uri += domain;
|
||||
}
|
||||
|
||||
uri += path;
|
||||
});
|
||||
}
|
||||
|
||||
window.cleanPath = true;
|
||||
|
||||
webview.url = uri;
|
||||
|
||||
//uriNav.text = uri.text.replace(/(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.\w{2,3})(.*)/, "$1$2<span style='color:#CCC'>$3</span>");
|
||||
uriNav.text = uri;
|
||||
} else {
|
||||
// Prevent inf loop.
|
||||
window.cleanPath = false;
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
webview.url = "http://etherian.io"
|
||||
}
|
||||
@ -103,43 +145,9 @@ import "../ext/qml_messaging.js" as Messaging
|
||||
top: navBar.bottom
|
||||
}
|
||||
|
||||
property var cleanPath: false
|
||||
//property var cleanPath: false
|
||||
onNavigationRequested: {
|
||||
if(!this.cleanPath) {
|
||||
var uri = request.url.toString();
|
||||
if(!/.*\:\/\/.*/.test(uri)) {
|
||||
uri = "http://" + uri;
|
||||
}
|
||||
|
||||
var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/
|
||||
|
||||
if(reg.test(uri)) {
|
||||
uri.replace(reg, function(match, pre, domain, path) {
|
||||
uri = pre;
|
||||
|
||||
var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4));
|
||||
var ip = [];
|
||||
for(var i = 0, l = lookup.length; i < l; i++) {
|
||||
ip.push(lookup.charCodeAt(i))
|
||||
}
|
||||
|
||||
if(ip.length != 0) {
|
||||
uri += lookup;
|
||||
} else {
|
||||
uri += domain;
|
||||
}
|
||||
|
||||
uri += path;
|
||||
});
|
||||
}
|
||||
|
||||
this.cleanPath = true;
|
||||
|
||||
webview.url = uri;
|
||||
} else {
|
||||
// Prevent inf loop.
|
||||
this.cleanPath = false;
|
||||
}
|
||||
window.open(request.url.toString());
|
||||
}
|
||||
|
||||
function sendMessage(data) {
|
||||
|
25
mist/gui.go
25
mist/gui.go
@ -172,7 +172,7 @@ func (gui *Gui) Stop() {
|
||||
}
|
||||
|
||||
func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) {
|
||||
component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/wallet.qml"))
|
||||
component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/main.qml"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -385,14 +385,13 @@ func (gui *Gui) update() {
|
||||
)
|
||||
|
||||
peerUpdateTicker := time.NewTicker(5 * time.Second)
|
||||
generalUpdateTicker := time.NewTicker(1 * time.Second)
|
||||
generalUpdateTicker := time.NewTicker(500 * time.Millisecond)
|
||||
statsUpdateTicker := time.NewTicker(5 * time.Second)
|
||||
|
||||
state := gui.eth.StateManager().TransState()
|
||||
|
||||
unconfirmedFunds := new(big.Int)
|
||||
gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance)))
|
||||
gui.getObjectByName("syncProgressIndicator").Set("visible", !gui.eth.IsUpToDate())
|
||||
|
||||
lastBlockLabel := gui.getObjectByName("lastBlockLabel")
|
||||
miningLabel := gui.getObjectByName("miningLabel")
|
||||
@ -439,9 +438,6 @@ func (gui *Gui) update() {
|
||||
|
||||
state.UpdateStateObject(object)
|
||||
}
|
||||
case msg := <-chainSyncChan:
|
||||
sync := msg.Resource.(bool)
|
||||
gui.win.Root().ObjectByName("syncProgressIndicator").Set("visible", sync)
|
||||
|
||||
case <-objectChan:
|
||||
gui.loadAddressBook()
|
||||
@ -464,9 +460,22 @@ func (gui *Gui) update() {
|
||||
miningLabel.Set("text", "Mining @ "+strconv.FormatInt(pow.GetHashrate(), 10)+"Khash")
|
||||
}
|
||||
|
||||
blockLength := gui.eth.BlockPool().BlocksProcessed
|
||||
chainLength := gui.eth.BlockPool().ChainLength
|
||||
|
||||
var (
|
||||
pct float64 = 1.0 / float64(chainLength) * float64(blockLength)
|
||||
dlWidget = gui.win.Root().ObjectByName("downloadIndicator")
|
||||
)
|
||||
if pct < 1.0 {
|
||||
dlWidget.Set("visible", true)
|
||||
dlWidget.Set("value", pct)
|
||||
} else {
|
||||
dlWidget.Set("visible", false)
|
||||
}
|
||||
|
||||
case <-statsUpdateTicker.C:
|
||||
gui.setStatsPane()
|
||||
|
||||
}
|
||||
}
|
||||
}()
|
||||
@ -491,7 +500,7 @@ func (gui *Gui) setStatsPane() {
|
||||
runtime.ReadMemStats(&memStats)
|
||||
|
||||
statsPane := gui.getObjectByName("statsPane")
|
||||
statsPane.Set("text", fmt.Sprintf(`###### Mist 0.6.5 (%s) #######
|
||||
statsPane.Set("text", fmt.Sprintf(`###### Mist 0.6.7 (%s) #######
|
||||
|
||||
eth %d (p2p = %d)
|
||||
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
const (
|
||||
ClientIdentifier = "Mist"
|
||||
Version = "0.6.5"
|
||||
Version = "0.6.7"
|
||||
)
|
||||
|
||||
var ethereum *eth.Ethereum
|
||||
|
@ -71,6 +71,32 @@ func (self *UiLib) LookupDomain(domain string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func (self *UiLib) LookupName(addr string) string {
|
||||
var (
|
||||
nameReg = self.World().Config().Get("NameReg")
|
||||
lookup = nameReg.Storage(ethutil.Hex2Bytes(addr))
|
||||
)
|
||||
|
||||
if lookup.Len() != 0 {
|
||||
return strings.Trim(lookup.Str(), "\x00")
|
||||
}
|
||||
|
||||
return addr
|
||||
}
|
||||
|
||||
func (self *UiLib) LookupAddress(name string) string {
|
||||
var (
|
||||
nameReg = self.World().Config().Get("NameReg")
|
||||
lookup = nameReg.Storage(ethutil.RightPadBytes([]byte(name), 32))
|
||||
)
|
||||
|
||||
if lookup.Len() != 0 {
|
||||
return ethutil.Bytes2Hex(lookup.Bytes())
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func (self *UiLib) PastPeers() *ethutil.List {
|
||||
return ethutil.NewList(eth.PastPeers())
|
||||
}
|
||||
@ -188,9 +214,9 @@ func (self *UiLib) NewFilterString(typ string) int {
|
||||
func (self *UiLib) Messages(id int) *ethutil.List {
|
||||
filter := self.eth.GetFilter(id)
|
||||
if filter != nil {
|
||||
messages := filter.Find()
|
||||
messages := ethpipe.ToJSMessages(filter.Find())
|
||||
|
||||
return ethpipe.ToJSMessages(messages)
|
||||
return messages
|
||||
}
|
||||
|
||||
return ethutil.EmptyList()
|
||||
@ -240,7 +266,6 @@ func mapToTxParams(object map[string]interface{}) map[string]string {
|
||||
dataStr += str
|
||||
}
|
||||
object["data"] = dataStr
|
||||
fmt.Println(object)
|
||||
|
||||
conv := make(map[string]string)
|
||||
for key, value := range object {
|
||||
|
Reference in New Issue
Block a user