Browse Source

common fixes

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
fafd0aed91
  1. 4
      alethzero/MainWin.cpp
  2. 22
      libjsqrc/main.js
  3. 22
      libjsqrc/qt.js
  4. 6
      libweb3jsonrpc/WebThreeStubServer.cpp
  5. 73
      libweb3jsonrpc/spec.json

4
alethzero/MainWin.cpp

@ -88,14 +88,14 @@ static QString fromRaw(dev::h256 _n, unsigned* _inc = nullptr)
static std::vector<dev::KeyPair> keysAsVector(QList<dev::KeyPair> const& keys)
{
auto list = keys.toStdList();
return {std::begin(list), std::end(list)};
return {begin(list), end(list)};
}
static QString contentsOfQResource(std::string const& res)
{
QFile file(QString::fromStdString(res));
if (!file.open(QFile::ReadOnly))
return "";
BOOST_THROW_EXCEPTION(FileError());
QTextStream in(&file);
return in.readAll();
}

22
libjsqrc/main.js

@ -1,3 +1,25 @@
/*
This file is part of ethereum.js.
ethereum.js is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ethereum.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file ethereum.js
* @authors:
* Marek Kotewicz <marek@ethdev.com>
* @date 2014
*/
(function(window) {
function isPromise(o) {
return o instanceof Promise

22
libjsqrc/qt.js

@ -1,3 +1,25 @@
/*
This file is part of ethereum.js.
ethereum.js is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ethereum.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file ethereum.js
* @authors:
* Marek Kotewicz <marek@ethdev.com>
* @date 2014
*/
(function() {
var QtProvider = function() {
this.handlers = [];

6
libweb3jsonrpc/WebThreeStubServer.cpp

@ -100,9 +100,8 @@ static Json::Value toJson(dev::eth::Transaction const& _t)
static dev::eth::MessageFilter toMessageFilter(Json::Value const& _json)
{
dev::eth::MessageFilter filter;
if (!_json.isObject() || _json.empty()){
if (!_json.isObject() || _json.empty())
return filter;
}
if (!_json["earliest"].empty())
filter.withEarliest(_json["earliest"].asInt());
@ -298,9 +297,8 @@ Json::Value WebThreeStubServer::blockByNumber(int const& _number)
static TransactionSkeleton toTransaction(Json::Value const& _json)
{
TransactionSkeleton ret;
if (!_json.isObject() || _json.empty()){
if (!_json.isObject() || _json.empty())
return ret;
}
if (!_json["from"].empty())
ret.from = jsToAddress(_json["from"].asString());

73
libweb3jsonrpc/spec.json

@ -1,40 +1,40 @@
[
{ "method": "coinbase", "params": [], "order": [], "returns" : "" },
{ "method": "setCoinbase", "params": [""], "order": [], "returns" : true },
{ "method": "listening", "params": [], "order": [], "returns" : false },
{ "method": "setListening", "params": [false], "order" : [], "returns" : true },
{ "method": "mining", "params": [], "order": [], "returns" : false },
{ "method": "setMining", "params": [false], "order" : [], "returns" : true },
{ "method": "gasPrice", "params": [], "order": [], "returns" : "" },
{ "method": "account", "params": [], "order": [], "returns" : "" },
{ "method": "accounts", "params": [], "order": [], "returns" : [] },
{ "method": "peerCount", "params": [], "order": [], "returns" : 0 },
{ "method": "defaultBlock", "params": [], "order": [], "returns" : 0},
{ "method": "setDefaultBlock", "params": [0], "order": [], "returns" : true},
{ "method": "number", "params": [], "order": [], "returns" : 0},
{ "method": "balanceAt", "params": [""], "order": [], "returns" : ""},
{ "method": "stateAt", "params": ["", ""], "order": [], "returns": ""},
{ "method": "countAt", "params": [""], "order": [], "returns" : 0.0},
{ "method": "codeAt", "params": [""], "order": [], "returns": ""},
{ "method": "transact", "params": [{}], "order": [], "returns": ""},
{ "method": "call", "params": [{}], "order": [], "returns": ""},
{ "method": "blockByHash", "params": [""],"order": [], "returns": {}},
{ "method": "blockByNumber", "params": [0],"order": [], "returns": {}},
{ "method": "transactionByHash", "params": ["", 0], "order": [], "returns": {}},
{ "method": "transactionByNumber", "params": [0, 0], "order": [], "returns": {}},
{ "method": "uncleByHash", "params": ["", 0], "order": [], "returns": {}},
{ "method": "uncleByNumber", "params": [0, 0], "order": [], "returns": {}},
{ "method": "coinbase", "params": [], "order": [], "returns" : "" },
{ "method": "setCoinbase", "params": [""], "order": [], "returns" : true },
{ "method": "listening", "params": [], "order": [], "returns" : false },
{ "method": "setListening", "params": [false], "order" : [], "returns" : true },
{ "method": "mining", "params": [], "order": [], "returns" : false },
{ "method": "setMining", "params": [false], "order" : [], "returns" : true },
{ "method": "gasPrice", "params": [], "order": [], "returns" : "" },
{ "method": "account", "params": [], "order": [], "returns" : "" },
{ "method": "accounts", "params": [], "order": [], "returns" : [] },
{ "method": "peerCount", "params": [], "order": [], "returns" : 0 },
{ "method": "defaultBlock", "params": [], "order": [], "returns" : 0},
{ "method": "setDefaultBlock", "params": [0], "order": [], "returns" : true},
{ "method": "number", "params": [], "order": [], "returns" : 0},
{ "method": "balanceAt", "params": [""], "order": [], "returns" : ""},
{ "method": "stateAt", "params": ["", ""], "order": [], "returns": ""},
{ "method": "countAt", "params": [""], "order": [], "returns" : 0.0},
{ "method": "codeAt", "params": [""], "order": [], "returns": ""},
{ "method": "transact", "params": [{}], "order": [], "returns": ""},
{ "method": "call", "params": [{}], "order": [], "returns": ""},
{ "method": "blockByHash", "params": [""],"order": [], "returns": {}},
{ "method": "blockByNumber", "params": [0],"order": [], "returns": {}},
{ "method": "transactionByHash", "params": ["", 0], "order": [], "returns": {}},
{ "method": "transactionByNumber", "params": [0, 0], "order": [], "returns": {}},
{ "method": "uncleByHash", "params": ["", 0], "order": [], "returns": {}},
{ "method": "uncleByNumber", "params": [0, 0], "order": [], "returns": {}},
{ "method": "compile", "params": [""], "order": [], "returns": ""},
{ "method": "newFilter", "params": [{}], "order": [], "returns": 0},
{ "method": "newFilterString", "params": [""], "order": [], "returns": 0},
{ "method": "uninstallFilter", "params": [0], "order": [], "returns": true},
{ "method": "changed", "params": [0], "order": [], "returns": false},
{ "method": "getMessages", "params": [0], "order": [], "returns": []},
{ "method": "newFilter", "params": [{}], "order": [], "returns": 0},
{ "method": "newFilterString", "params": [""], "order": [], "returns": 0},
{ "method": "uninstallFilter", "params": [0], "order": [], "returns": true},
{ "method": "changed", "params": [0], "order": [], "returns": false},
{ "method": "getMessages", "params": [0], "order": [], "returns": []},
{ "method": "put", "params": ["", "", ""], "order": [], "returns": true},
{ "method": "get", "params": ["", ""], "order": [], "returns": ""},
@ -46,11 +46,10 @@
{ "method": "haveIdentity", "params": [""], "order": [], "returns": false},
{ "method": "newGroup", "params": ["", ""], "order": [], "returns": ""},
{ "method": "addToGroup", "params": ["", ""], "order": [], "returns": ""},
{ "method": "shhNewFilter", "params": [{}], "order": [], "returns": 0},
{ "method": "shhUninstallFilter", "params": [0], "order": [], "returns": true},
{ "method": "shhChanged", "params": [0], "order": [], "returns": []}
{ "method": "shhUninstallFilter", "params": [0], "order": [], "returns": true},
{ "method": "shhChanged", "params": [0], "order": [], "returns": []}
]

Loading…
Cancel
Save