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. 1
      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());

1
libweb3jsonrpc/spec.json

@ -53,4 +53,3 @@
]

Loading…
Cancel
Save