Skip to content

Commit 1fc3524

Browse files
committed
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
2 parents df49c60 + ebc506d commit 1fc3524

10 files changed

Lines changed: 113 additions & 135 deletions

File tree

‎.travis.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ install:
1111
# - go get golang.org/x/tools/cmd/vet
1212
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
1313
- go get github.com/mattn/goveralls
14-
- go get -d github.com/obscuren/qml && cd $HOME/gopath/src/github.com/obscuren/qml && git checkout v1 && cd $TRAVIS_BUILD_DIR
15-
- ETH_DEPS=$(go list -f '{{.Imports}} {{.TestImports}} {{.XTestImports}}' github.com/ethereum/go-ethereum/... | sed -e 's/\[//g' | sed -e 's/\]//g' | sed -e 's/C //g'); if [ "$ETH_DEPS" ]; then go get -d $ETH_DEPS; fi
14+
- go get gopkg.in/check.v1
15+
- DEPS=$(go list -f '{{.Imports}}' ./... | sed -e 's/\[//g' | sed -e 's/\]//g' | sed -e 's/C //g'); if [ "$DEPS" ]; then go get -d -v $DEPS; fi
1616
before_script:
1717
- gofmt -l -w .
1818
- goimports -l -w .
1919
- golint .
2020
# - go vet ./...
2121
# - go test -race ./...
2222
script:
23-
- ./gocoverage.sh && if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
23+
- ./gocoverage.sh
24+
after_success:
25+
- if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
2426
env:
2527
global:
2628
- PKG_CONFIG_PATH=/opt/qt54/lib/pkgconfig

‎Dockerfile‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ RUN apt-get install -y qt54quickcontrols qt54webengine
2121
## Build and install latest Go
2222
RUN git clone https://go.googlesource.com/go golang
2323
RUN cd golang && git checkout go1.4.1
24-
RUN cd golang/src && ./all.bash && go version
24+
RUN cd golang/src && ./make.bash && go version
2525

26-
## Fetch and install QML
27-
RUN go get -u -v -d github.com/obscuren/qml
28-
WORKDIR $GOPATH/src/github.com/obscuren/qml
29-
RUN git checkout v1
30-
RUN go install -v
26+
# this is a workaround, to make sure that docker's cache is invalidated whenever the git repo changes
27+
ADD https://api.github.com/repos/ethereum/go-ethereum/git/refs/heads/develop file_does_not_exist
3128

3229
## Fetch and install go-ethereum
3330
RUN go get -u -v -d github.com/ethereum/go-ethereum/...

‎cmd/mist/assets/qml/main.qml‎

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ApplicationWindow {
3939
// Takes care of loading all default plugins
4040
Component.onCompleted: {
4141

42-
addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin"});
42+
var catalog = addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin"});
4343
var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum", active: true});
4444

4545
addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: true});
@@ -49,9 +49,9 @@ ApplicationWindow {
4949
addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"});
5050
addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});
5151

52-
mainSplit.setView(wallet.view, wallet.menuItem);
52+
mainSplit.setView(catalog.view, catalog.menuItem);
5353

54-
newBrowserTab("http://ethereum-dapp-whisper-client.meteor.com/chat/amsteam");
54+
//newBrowserTab("http://ethereum-dapp-catalog.meteor.com");
5555

5656
// Command setup
5757
gui.sendCommand(0)
@@ -114,10 +114,33 @@ ApplicationWindow {
114114
}
115115

116116
function newBrowserTab(url) {
117-
var window = addPlugin("./views/browser.qml", {noAdd: true, close: true, section: "apps", active: true});
118-
window.view.url = url;
119-
window.menuItem.title = "Mist";
120-
activeView(window.view, window.menuItem);
117+
118+
var urlMatches = url.toString().match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
119+
var requestedDomain = urlMatches && urlMatches[1];
120+
121+
var domainAlreadyOpen = false;
122+
123+
console.log("requested: " + requestedDomain )
124+
125+
for(var i = 0; i < mainSplit.views.length; i++) {
126+
if (mainSplit.views[i].view.url) {
127+
var matches = mainSplit.views[i].view.url.toString().match(/^[a-z]*\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
128+
var existingDomain = matches && matches[1];
129+
console.log("exists: " + existingDomain);
130+
if (requestedDomain == existingDomain) {
131+
domainAlreadyOpen = true;
132+
mainSplit.views[i].view.url = url;
133+
activeView(mainSplit.views[i].view, mainSplit.views[i].menuItem);
134+
}
135+
}
136+
}
137+
138+
if (!domainAlreadyOpen) {
139+
var window = addPlugin("./views/browser.qml", {noAdd: true, close: true, section: "apps", active: true});
140+
window.view.url = url;
141+
window.menuItem.title = "Mist";
142+
activeView(window.view, window.menuItem);
143+
}
121144
}
122145

123146

@@ -332,8 +355,9 @@ ApplicationWindow {
332355

333356
id: mainSplit
334357
anchors.fill: parent
335-
resizing: false
358+
//resizing: false // this is NOT where we remove that damning resizing handle..
336359
handleDelegate: Item {
360+
//This handle is a way to remove the line between the split views
337361
Rectangle {
338362
anchors.fill: parent
339363
}
@@ -497,7 +521,7 @@ ApplicationWindow {
497521
anchors.fill: parent
498522
border.width: 0
499523
radius: 5
500-
color: "#FFFFFFFF"
524+
color: "#FAFAFA"
501525
}
502526
Rectangle {
503527
anchors {
@@ -506,7 +530,7 @@ ApplicationWindow {
506530
right: r.right
507531
}
508532
width: 10
509-
color: "#FFFFFFFF"
533+
color: "#FAFAFA"
510534
border.width:0
511535

512536
Rectangle {
@@ -517,7 +541,7 @@ ApplicationWindow {
517541
top: parent.top
518542
}
519543
height: 1
520-
color: "#FFFFFF"
544+
color: "#FAFAFA"
521545
}
522546

523547
Rectangle {
@@ -528,7 +552,7 @@ ApplicationWindow {
528552
bottom: parent.bottom
529553
}
530554
height: 1
531-
color: "#FFFFFF"
555+
color: "#FAFAFA"
532556
}
533557
}
534558
}
@@ -800,7 +824,7 @@ ApplicationWindow {
800824
anchors.top: parent.top
801825
color: "#00000000"
802826

803-
Rectangle {
827+
/*Rectangle {
804828
id: urlPane
805829
height: 40
806830
color: "#00000000"
@@ -847,15 +871,15 @@ ApplicationWindow {
847871
z: -1
848872
height: 1
849873
color: "#CCCCCC"
850-
}
874+
}*/
851875

852876
Rectangle {
853877
id: mainView
854878
color: "#00000000"
855879
anchors.right: parent.right
856880
anchors.left: parent.left
857881
anchors.bottom: parent.bottom
858-
anchors.top: divider.bottom
882+
anchors.top: parent.top
859883

860884
function createView(component) {
861885
var view = component.createObject(mainView)

‎cmd/mist/assets/qml/views/browser.qml‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,21 @@ Rectangle {
345345
if (topBarStyle=="transparent") {
346346

347347
// Adjust for a transparent sidebar Dapp
348-
navBarBackground.visible = false;
349-
back.visible = false;
350-
appInfoPane.anchors.leftMargin = -16;
351-
appInfoPaneShadow.anchors.leftMargin = -16;
352-
webview.anchors.topMargin = -74;
348+
navBarBackground.visible = false;
349+
back.visible = false;
350+
appInfoPane.anchors.leftMargin = -16;
351+
appInfoPaneShadow.anchors.leftMargin = -16;
352+
webview.anchors.topMargin = -74;
353353
webview.runJavaScript("document.querySelector('body').classList.add('ethereum-dapp-url-bar-style-transparent')")
354354

355-
};
355+
} else {
356+
navBarBackground.visible = true;
357+
back.visible = true;
358+
appInfoPane.anchors.leftMargin = 0;
359+
appInfoPaneShadow.anchors.leftMargin = 0;
360+
webview.anchors.topMargin = 0;
361+
362+
};
356363
});
357364

358365

‎cmd/mist/assets/qml/views/catalog.qml‎

Lines changed: 44 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Rectangle {
1212
anchors.fill: parent
1313
color: "#00000000"
1414

15-
property var title: ""
15+
property var title: "Catalog"
1616
property var iconSource: ""
1717
property var menuItem
1818
property var hideUrl: true
@@ -75,111 +75,57 @@ Rectangle {
7575
anchors.fill: parent
7676
state: "inspectorShown"
7777

78-
RowLayout {
79-
id: navBar
80-
height: 184
81-
z: 20
82-
83-
anchors {
84-
left: parent.left
85-
right: parent.right
86-
}
87-
88-
Rectangle {
89-
id: appInfoPane
90-
height: 28
91-
color: "#efefef"
92-
radius: 6
93-
z:25
94-
95-
MouseArea {
96-
anchors.fill: parent
97-
z: 10
98-
hoverEnabled: true
99-
onEntered: {
100-
uriNav.visible = true
101-
appTitle.visible = false
102-
appDomain.visible = false
103-
}
104-
}
105-
106-
anchors {
107-
left: parent.left
108-
right: parent.right
109-
leftMargin: 10
110-
rightMargin: 10
111-
top: parent.verticalCenter
112-
topMargin: 23
113-
}
114-
115-
TextField {
116-
id: uriNav
117-
anchors {
118-
left: parent.left
119-
right: parent.right
120-
leftMargin: 16
121-
top: parent.verticalCenter
122-
topMargin: -10
123-
}
124-
125-
horizontalAlignment: Text.AlignHCenter
126-
127-
style: TextFieldStyle {
128-
textColor: "#928484"
129-
background: Rectangle {
130-
border.width: 0
131-
color: "transparent"
132-
}
133-
}
134-
text: "Type the address of a new Dapp";
135-
y: parent.height / 2 - this.height / 2
136-
z: 30
137-
activeFocusOnPress: true
138-
Keys.onReturnPressed: {
139-
newBrowserTab(this.text);
140-
this.text = "Type the address of a new Dapp";
141-
}
142-
143-
}
144-
}
145-
146-
Rectangle {
147-
id: appInfoPaneShadow
148-
width: 10
149-
height: 30
150-
color: "#BDB6B6"
151-
radius: 6
152-
z: 15
153-
154-
anchors {
155-
left: parent.left
156-
right: parent.right
157-
leftMargin:10
158-
rightMargin:10
159-
top: parent.verticalCenter
160-
topMargin: 23
161-
}
162-
163-
164-
}
165-
166-
}
167-
168-
16978
WebEngineView {
17079
objectName: "webView"
17180
id: webview
17281
anchors.fill: parent
17382

174-
onLoadingChanged: {
175-
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
176-
webview.runJavaScript(eth.readFile("bignumber.min.js"));
177-
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
178-
}
179-
}
83+
property var protocol: "http://"
84+
//property var domain: "localhost:3000"
85+
property var domain: "ethereum-dapp-catalog.meteor.com"
86+
url: protocol + domain
87+
88+
//navigationRequest: WebEngineView.IgnoreRequest
89+
// onLoadingChanged: {
90+
// if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
91+
// webview.runJavaScript(eth.readFile("bignumber.min.js"));
92+
// webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
93+
// }
94+
// }
95+
96+
//onNavigationRequested: {
97+
// detect URL scheme prefix, most likely an external link
98+
//var schemaRE = /^\w+:/;
99+
//if (schemaRE.test(request.url)) {
100+
// request.action = WebView.AcceptRequest;
101+
//} else {
102+
//request.action = WebView.IgnoreRequest;
103+
// delegate request.url here
104+
//}
105+
//}
106+
180107
onJavaScriptConsoleMessage: {
181108
console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message));
182109
}
110+
111+
onNavigationRequested: {
112+
var cleanTitle = request.url.toString()
113+
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
114+
var requestedDomain = matches && matches[1];
115+
116+
console.debug ("NavigationRequested: " + request.url + " navigationType=" + request.navigationType)
117+
118+
if(request.navigationType==0){
119+
120+
if (requestedDomain === this.domain){
121+
request.action = WebEngineView.AcceptRequest;
122+
} else {
123+
request.action = WebEngineView.IgnoreRequest;
124+
newBrowserTab(request.url);
125+
}
126+
127+
}
128+
}
183129
}
184130

185131

‎eth/block_pool_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ func TestInvalidBlock(t *testing.T) {
613613
}
614614

615615
func TestVerifyPoW(t *testing.T) {
616+
t.Skip("***FIX*** This test is broken")
616617
logInit()
617618
_, blockPool, blockPoolTester := newTestBlockPool(t)
618619
blockPoolTester.blockChain[0] = nil

‎rpc/http/server.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (s *RpcHttpServer) apiHandler(api *rpc.EthereumApi) http.Handler {
102102
if reserr != nil {
103103
rpchttplogger.Warnln(reserr)
104104
jsonerr := &rpc.RpcErrorObject{-32603, reserr.Error()}
105-
JSON.Send(w, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: &reqParsed.ID, Error: jsonerr})
105+
JSON.Send(w, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: reqParsed.ID, Error: jsonerr})
106106
return
107107
}
108108

0 commit comments

Comments
 (0)