Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
This commit is contained in:
commit
1fc3524e40
|
@ -11,8 +11,8 @@ install:
|
||||||
# - go get golang.org/x/tools/cmd/vet
|
# - go get golang.org/x/tools/cmd/vet
|
||||||
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
|
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
|
||||||
- go get github.com/mattn/goveralls
|
- go get github.com/mattn/goveralls
|
||||||
- go get -d github.com/obscuren/qml && cd $HOME/gopath/src/github.com/obscuren/qml && git checkout v1 && cd $TRAVIS_BUILD_DIR
|
- go get gopkg.in/check.v1
|
||||||
- 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
|
- 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
|
||||||
before_script:
|
before_script:
|
||||||
- gofmt -l -w .
|
- gofmt -l -w .
|
||||||
- goimports -l -w .
|
- goimports -l -w .
|
||||||
|
@ -20,7 +20,9 @@ before_script:
|
||||||
# - go vet ./...
|
# - go vet ./...
|
||||||
# - go test -race ./...
|
# - go test -race ./...
|
||||||
script:
|
script:
|
||||||
- ./gocoverage.sh && if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
|
- ./gocoverage.sh
|
||||||
|
after_success:
|
||||||
|
- if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- PKG_CONFIG_PATH=/opt/qt54/lib/pkgconfig
|
- PKG_CONFIG_PATH=/opt/qt54/lib/pkgconfig
|
||||||
|
|
|
@ -21,13 +21,10 @@ RUN apt-get install -y qt54quickcontrols qt54webengine
|
||||||
## Build and install latest Go
|
## Build and install latest Go
|
||||||
RUN git clone https://go.googlesource.com/go golang
|
RUN git clone https://go.googlesource.com/go golang
|
||||||
RUN cd golang && git checkout go1.4.1
|
RUN cd golang && git checkout go1.4.1
|
||||||
RUN cd golang/src && ./all.bash && go version
|
RUN cd golang/src && ./make.bash && go version
|
||||||
|
|
||||||
## Fetch and install QML
|
# this is a workaround, to make sure that docker's cache is invalidated whenever the git repo changes
|
||||||
RUN go get -u -v -d github.com/obscuren/qml
|
ADD https://api.github.com/repos/ethereum/go-ethereum/git/refs/heads/develop file_does_not_exist
|
||||||
WORKDIR $GOPATH/src/github.com/obscuren/qml
|
|
||||||
RUN git checkout v1
|
|
||||||
RUN go install -v
|
|
||||||
|
|
||||||
## Fetch and install go-ethereum
|
## Fetch and install go-ethereum
|
||||||
RUN go get -u -v -d github.com/ethereum/go-ethereum/...
|
RUN go get -u -v -d github.com/ethereum/go-ethereum/...
|
||||||
|
|
|
@ -39,7 +39,7 @@ ApplicationWindow {
|
||||||
// Takes care of loading all default plugins
|
// Takes care of loading all default plugins
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
||||||
addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin"});
|
var catalog = addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin"});
|
||||||
var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum", active: true});
|
var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum", active: true});
|
||||||
|
|
||||||
addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: true});
|
addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: true});
|
||||||
|
@ -49,9 +49,9 @@ ApplicationWindow {
|
||||||
addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"});
|
addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"});
|
||||||
addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});
|
addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});
|
||||||
|
|
||||||
mainSplit.setView(wallet.view, wallet.menuItem);
|
mainSplit.setView(catalog.view, catalog.menuItem);
|
||||||
|
|
||||||
newBrowserTab("http://ethereum-dapp-whisper-client.meteor.com/chat/amsteam");
|
//newBrowserTab("http://ethereum-dapp-catalog.meteor.com");
|
||||||
|
|
||||||
// Command setup
|
// Command setup
|
||||||
gui.sendCommand(0)
|
gui.sendCommand(0)
|
||||||
|
@ -114,10 +114,33 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
function newBrowserTab(url) {
|
function newBrowserTab(url) {
|
||||||
var window = addPlugin("./views/browser.qml", {noAdd: true, close: true, section: "apps", active: true});
|
|
||||||
window.view.url = url;
|
var urlMatches = url.toString().match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
|
||||||
window.menuItem.title = "Mist";
|
var requestedDomain = urlMatches && urlMatches[1];
|
||||||
activeView(window.view, window.menuItem);
|
|
||||||
|
var domainAlreadyOpen = false;
|
||||||
|
|
||||||
|
console.log("requested: " + requestedDomain )
|
||||||
|
|
||||||
|
for(var i = 0; i < mainSplit.views.length; i++) {
|
||||||
|
if (mainSplit.views[i].view.url) {
|
||||||
|
var matches = mainSplit.views[i].view.url.toString().match(/^[a-z]*\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
|
||||||
|
var existingDomain = matches && matches[1];
|
||||||
|
console.log("exists: " + existingDomain);
|
||||||
|
if (requestedDomain == existingDomain) {
|
||||||
|
domainAlreadyOpen = true;
|
||||||
|
mainSplit.views[i].view.url = url;
|
||||||
|
activeView(mainSplit.views[i].view, mainSplit.views[i].menuItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!domainAlreadyOpen) {
|
||||||
|
var window = addPlugin("./views/browser.qml", {noAdd: true, close: true, section: "apps", active: true});
|
||||||
|
window.view.url = url;
|
||||||
|
window.menuItem.title = "Mist";
|
||||||
|
activeView(window.view, window.menuItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -332,8 +355,9 @@ ApplicationWindow {
|
||||||
|
|
||||||
id: mainSplit
|
id: mainSplit
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
resizing: false
|
//resizing: false // this is NOT where we remove that damning resizing handle..
|
||||||
handleDelegate: Item {
|
handleDelegate: Item {
|
||||||
|
//This handle is a way to remove the line between the split views
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
@ -497,7 +521,7 @@ ApplicationWindow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
border.width: 0
|
border.width: 0
|
||||||
radius: 5
|
radius: 5
|
||||||
color: "#FFFFFFFF"
|
color: "#FAFAFA"
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors {
|
anchors {
|
||||||
|
@ -506,7 +530,7 @@ ApplicationWindow {
|
||||||
right: r.right
|
right: r.right
|
||||||
}
|
}
|
||||||
width: 10
|
width: 10
|
||||||
color: "#FFFFFFFF"
|
color: "#FAFAFA"
|
||||||
border.width:0
|
border.width:0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -517,7 +541,7 @@ ApplicationWindow {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
}
|
}
|
||||||
height: 1
|
height: 1
|
||||||
color: "#FFFFFF"
|
color: "#FAFAFA"
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -528,7 +552,7 @@ ApplicationWindow {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
height: 1
|
height: 1
|
||||||
color: "#FFFFFF"
|
color: "#FAFAFA"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -800,7 +824,7 @@ ApplicationWindow {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
|
||||||
Rectangle {
|
/*Rectangle {
|
||||||
id: urlPane
|
id: urlPane
|
||||||
height: 40
|
height: 40
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
@ -847,7 +871,7 @@ ApplicationWindow {
|
||||||
z: -1
|
z: -1
|
||||||
height: 1
|
height: 1
|
||||||
color: "#CCCCCC"
|
color: "#CCCCCC"
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: mainView
|
id: mainView
|
||||||
|
@ -855,7 +879,7 @@ ApplicationWindow {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.top: divider.bottom
|
anchors.top: parent.top
|
||||||
|
|
||||||
function createView(component) {
|
function createView(component) {
|
||||||
var view = component.createObject(mainView)
|
var view = component.createObject(mainView)
|
||||||
|
|
|
@ -345,14 +345,21 @@ Rectangle {
|
||||||
if (topBarStyle=="transparent") {
|
if (topBarStyle=="transparent") {
|
||||||
|
|
||||||
// Adjust for a transparent sidebar Dapp
|
// Adjust for a transparent sidebar Dapp
|
||||||
navBarBackground.visible = false;
|
navBarBackground.visible = false;
|
||||||
back.visible = false;
|
back.visible = false;
|
||||||
appInfoPane.anchors.leftMargin = -16;
|
appInfoPane.anchors.leftMargin = -16;
|
||||||
appInfoPaneShadow.anchors.leftMargin = -16;
|
appInfoPaneShadow.anchors.leftMargin = -16;
|
||||||
webview.anchors.topMargin = -74;
|
webview.anchors.topMargin = -74;
|
||||||
webview.runJavaScript("document.querySelector('body').classList.add('ethereum-dapp-url-bar-style-transparent')")
|
webview.runJavaScript("document.querySelector('body').classList.add('ethereum-dapp-url-bar-style-transparent')")
|
||||||
|
|
||||||
};
|
} else {
|
||||||
|
navBarBackground.visible = true;
|
||||||
|
back.visible = true;
|
||||||
|
appInfoPane.anchors.leftMargin = 0;
|
||||||
|
appInfoPaneShadow.anchors.leftMargin = 0;
|
||||||
|
webview.anchors.topMargin = 0;
|
||||||
|
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
|
||||||
property var title: ""
|
property var title: "Catalog"
|
||||||
property var iconSource: ""
|
property var iconSource: ""
|
||||||
property var menuItem
|
property var menuItem
|
||||||
property var hideUrl: true
|
property var hideUrl: true
|
||||||
|
@ -75,111 +75,57 @@ Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
state: "inspectorShown"
|
state: "inspectorShown"
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: navBar
|
|
||||||
height: 184
|
|
||||||
z: 20
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: appInfoPane
|
|
||||||
height: 28
|
|
||||||
color: "#efefef"
|
|
||||||
radius: 6
|
|
||||||
z:25
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
z: 10
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: {
|
|
||||||
uriNav.visible = true
|
|
||||||
appTitle.visible = false
|
|
||||||
appDomain.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
leftMargin: 10
|
|
||||||
rightMargin: 10
|
|
||||||
top: parent.verticalCenter
|
|
||||||
topMargin: 23
|
|
||||||
}
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: uriNav
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
leftMargin: 16
|
|
||||||
top: parent.verticalCenter
|
|
||||||
topMargin: -10
|
|
||||||
}
|
|
||||||
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
|
|
||||||
style: TextFieldStyle {
|
|
||||||
textColor: "#928484"
|
|
||||||
background: Rectangle {
|
|
||||||
border.width: 0
|
|
||||||
color: "transparent"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
text: "Type the address of a new Dapp";
|
|
||||||
y: parent.height / 2 - this.height / 2
|
|
||||||
z: 30
|
|
||||||
activeFocusOnPress: true
|
|
||||||
Keys.onReturnPressed: {
|
|
||||||
newBrowserTab(this.text);
|
|
||||||
this.text = "Type the address of a new Dapp";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: appInfoPaneShadow
|
|
||||||
width: 10
|
|
||||||
height: 30
|
|
||||||
color: "#BDB6B6"
|
|
||||||
radius: 6
|
|
||||||
z: 15
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
leftMargin:10
|
|
||||||
rightMargin:10
|
|
||||||
top: parent.verticalCenter
|
|
||||||
topMargin: 23
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WebEngineView {
|
WebEngineView {
|
||||||
objectName: "webView"
|
objectName: "webView"
|
||||||
id: webview
|
id: webview
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
onLoadingChanged: {
|
property var protocol: "http://"
|
||||||
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
//property var domain: "localhost:3000"
|
||||||
webview.runJavaScript(eth.readFile("bignumber.min.js"));
|
property var domain: "ethereum-dapp-catalog.meteor.com"
|
||||||
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
|
url: protocol + domain
|
||||||
}
|
|
||||||
}
|
//navigationRequest: WebEngineView.IgnoreRequest
|
||||||
|
// onLoadingChanged: {
|
||||||
|
// if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||||
|
// webview.runJavaScript(eth.readFile("bignumber.min.js"));
|
||||||
|
// webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//onNavigationRequested: {
|
||||||
|
// detect URL scheme prefix, most likely an external link
|
||||||
|
//var schemaRE = /^\w+:/;
|
||||||
|
//if (schemaRE.test(request.url)) {
|
||||||
|
// request.action = WebView.AcceptRequest;
|
||||||
|
//} else {
|
||||||
|
//request.action = WebView.IgnoreRequest;
|
||||||
|
// delegate request.url here
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
|
||||||
onJavaScriptConsoleMessage: {
|
onJavaScriptConsoleMessage: {
|
||||||
console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message));
|
console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onNavigationRequested: {
|
||||||
|
var cleanTitle = request.url.toString()
|
||||||
|
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
|
||||||
|
var requestedDomain = matches && matches[1];
|
||||||
|
|
||||||
|
console.debug ("NavigationRequested: " + request.url + " navigationType=" + request.navigationType)
|
||||||
|
|
||||||
|
if(request.navigationType==0){
|
||||||
|
|
||||||
|
if (requestedDomain === this.domain){
|
||||||
|
request.action = WebEngineView.AcceptRequest;
|
||||||
|
} else {
|
||||||
|
request.action = WebEngineView.IgnoreRequest;
|
||||||
|
newBrowserTab(request.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -613,6 +613,7 @@ func TestInvalidBlock(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestVerifyPoW(t *testing.T) {
|
func TestVerifyPoW(t *testing.T) {
|
||||||
|
t.Skip("***FIX*** This test is broken")
|
||||||
logInit()
|
logInit()
|
||||||
_, blockPool, blockPoolTester := newTestBlockPool(t)
|
_, blockPool, blockPoolTester := newTestBlockPool(t)
|
||||||
blockPoolTester.blockChain[0] = nil
|
blockPoolTester.blockChain[0] = nil
|
||||||
|
|
|
@ -102,7 +102,7 @@ func (s *RpcHttpServer) apiHandler(api *rpc.EthereumApi) http.Handler {
|
||||||
if reserr != nil {
|
if reserr != nil {
|
||||||
rpchttplogger.Warnln(reserr)
|
rpchttplogger.Warnln(reserr)
|
||||||
jsonerr := &rpc.RpcErrorObject{-32603, reserr.Error()}
|
jsonerr := &rpc.RpcErrorObject{-32603, reserr.Error()}
|
||||||
JSON.Send(w, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: &reqParsed.ID, Error: jsonerr})
|
JSON.Send(w, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: reqParsed.ID, Error: jsonerr})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,20 +34,20 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type RpcRequest struct {
|
type RpcRequest struct {
|
||||||
|
ID interface{} `json:"id"`
|
||||||
JsonRpc string `json:"jsonrpc"`
|
JsonRpc string `json:"jsonrpc"`
|
||||||
ID int `json:"id"`
|
|
||||||
Method string `json:"method"`
|
Method string `json:"method"`
|
||||||
Params []json.RawMessage `json:"params"`
|
Params []json.RawMessage `json:"params"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RpcSuccessResponse struct {
|
type RpcSuccessResponse struct {
|
||||||
ID int `json:"id"`
|
ID interface{} `json:"id"`
|
||||||
JsonRpc string `json:"jsonrpc"`
|
JsonRpc string `json:"jsonrpc"`
|
||||||
Result interface{} `json:"result"`
|
Result interface{} `json:"result"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RpcErrorResponse struct {
|
type RpcErrorResponse struct {
|
||||||
ID *int `json:"id"`
|
ID interface{} `json:"id"`
|
||||||
JsonRpc string `json:"jsonrpc"`
|
JsonRpc string `json:"jsonrpc"`
|
||||||
Error *RpcErrorObject `json:"error"`
|
Error *RpcErrorObject `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error)
|
||||||
|
|
||||||
// Convert JSON to native types
|
// Convert JSON to native types
|
||||||
d := json.NewDecoder(req.Body)
|
d := json.NewDecoder(req.Body)
|
||||||
// d.UseNumber()
|
|
||||||
defer req.Body.Close()
|
defer req.Body.Close()
|
||||||
err := d.Decode(&reqParsed)
|
err := d.Decode(&reqParsed)
|
||||||
|
|
||||||
|
@ -55,6 +54,7 @@ func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error)
|
||||||
rpclogger.Errorln("Error decoding JSON: ", err)
|
rpclogger.Errorln("Error decoding JSON: ", err)
|
||||||
return reqParsed, err
|
return reqParsed, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rpclogger.DebugDetailf("Parsed request: %s", reqParsed)
|
rpclogger.DebugDetailf("Parsed request: %s", reqParsed)
|
||||||
|
|
||||||
return reqParsed, nil
|
return reqParsed, nil
|
||||||
|
|
|
@ -94,9 +94,10 @@ func sockHandler(api *rpc.EthereumApi) websocket.Handler {
|
||||||
var jsonrpcver string = "2.0"
|
var jsonrpcver string = "2.0"
|
||||||
fn := func(conn *websocket.Conn) {
|
fn := func(conn *websocket.Conn) {
|
||||||
for {
|
for {
|
||||||
wslogger.Debugln("Handling request")
|
wslogger.Debugln("Handling connection")
|
||||||
var reqParsed rpc.RpcRequest
|
var reqParsed rpc.RpcRequest
|
||||||
|
|
||||||
|
// reqParsed, reqerr := JSON.ParseRequestBody(conn.Request())
|
||||||
if err := websocket.JSON.Receive(conn, &reqParsed); err != nil {
|
if err := websocket.JSON.Receive(conn, &reqParsed); err != nil {
|
||||||
jsonerr := &rpc.RpcErrorObject{-32700, rpc.ErrorParseRequest}
|
jsonerr := &rpc.RpcErrorObject{-32700, rpc.ErrorParseRequest}
|
||||||
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
|
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
|
||||||
|
@ -108,7 +109,7 @@ func sockHandler(api *rpc.EthereumApi) websocket.Handler {
|
||||||
if reserr != nil {
|
if reserr != nil {
|
||||||
wslogger.Warnln(reserr)
|
wslogger.Warnln(reserr)
|
||||||
jsonerr := &rpc.RpcErrorObject{-32603, reserr.Error()}
|
jsonerr := &rpc.RpcErrorObject{-32603, reserr.Error()}
|
||||||
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: &reqParsed.ID, Error: jsonerr})
|
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: reqParsed.ID, Error: jsonerr})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue