mirror of https://github.com/embarklabs/embark.git
Fix failing test on blockchain
This commit is contained in:
parent
b99c32eaad
commit
00410b7057
|
@ -3,7 +3,7 @@ const http = require('http');
|
||||||
const constants = require('../constants.json');
|
const constants = require('../constants.json');
|
||||||
|
|
||||||
let commList = {};
|
let commList = {};
|
||||||
let transactions = {};
|
let transactions = {};
|
||||||
let receipts = {};
|
let receipts = {};
|
||||||
|
|
||||||
const parseRequest = function(reqBody){
|
const parseRequest = function(reqBody){
|
||||||
|
@ -42,7 +42,7 @@ const parseResponse = function(ipc, resBody){
|
||||||
commList[receipts[jsonO.id]].blockNumber = jsonO.result.blockNumber;
|
commList[receipts[jsonO.id]].blockNumber = jsonO.result.blockNumber;
|
||||||
commList[receipts[jsonO.id]].gasUsed = jsonO.result.gasUsed;
|
commList[receipts[jsonO.id]].gasUsed = jsonO.result.gasUsed;
|
||||||
commList[receipts[jsonO.id]].status = jsonO.result.status;
|
commList[receipts[jsonO.id]].status = jsonO.result.status;
|
||||||
|
|
||||||
if(ipc.connected && !ipc.connecting){
|
if(ipc.connected && !ipc.connecting){
|
||||||
ipc.request('log', commList[receipts[jsonO.id]]);
|
ipc.request('log', commList[receipts[jsonO.id]]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -109,16 +109,17 @@ exports.serve = function(ipc, host, port, ws){
|
||||||
parseResponse(ipc, data.toString().substr(data.indexOf("{")));
|
parseResponse(ipc, data.toString().substr(data.indexOf("{")));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
proxy.on('proxyReqWs', (proxyReq, req, socket) => {
|
proxy.on('proxyReqWs', (proxyReq, req, socket) => {
|
||||||
var parser = new WsParser(0, false);
|
var parser = new WsParser(0, false);
|
||||||
socket.pipe(parser);
|
socket.pipe(parser);
|
||||||
parser.on('frame', function (frame) {
|
parser.on('frame', function (frame) {
|
||||||
parseRequest(frame.data);
|
parseRequest(frame.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
server.listen(port);
|
server.listen(port);
|
||||||
|
return server;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue