Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Convert tabs to spaces in Account and LegacyVM #5232

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions libethereum/Account.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
This file is part of cpp-ethereum.
This file is part of cpp-ethereum.

cpp-ethereum 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.
cpp-ethereum 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.

cpp-ethereum 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.
cpp-ethereum 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 cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file Account.cpp
* @author Gav Wood <i@gavwood.com>
Expand All @@ -34,9 +34,9 @@ namespace fs = boost::filesystem;

void Account::setCode(bytes&& _code)
{
m_codeCache = std::move(_code);
m_hasNewCode = true;
m_codeHash = sha3(m_codeCache);
m_codeCache = std::move(_code);
m_hasNewCode = true;
m_codeHash = sha3(m_codeCache);
}

namespace js = json_spirit;
Expand All @@ -46,42 +46,42 @@ namespace

uint64_t toUnsigned(js::mValue const& _v)
{
switch (_v.type())
{
case js::int_type: return _v.get_uint64();
case js::str_type: return fromBigEndian<uint64_t>(fromHex(_v.get_str()));
default: return 0;
}
switch (_v.type())
{
case js::int_type: return _v.get_uint64();
case js::str_type: return fromBigEndian<uint64_t>(fromHex(_v.get_str()));
default: return 0;
}
}

PrecompiledContract createPrecompiledContract(js::mObject const& _precompiled)
{
auto n = _precompiled.at("name").get_str();
try
{
u256 startingBlock = 0;
if (_precompiled.count("startingBlock"))
{
u256 startingBlock = 0;
if (_precompiled.count("startingBlock"))
startingBlock = u256(_precompiled.at("startingBlock").get_str());

if (!_precompiled.count("linear"))
return PrecompiledContract(PrecompiledRegistrar::pricer(n), PrecompiledRegistrar::executor(n), startingBlock);
return PrecompiledContract(PrecompiledRegistrar::pricer(n), PrecompiledRegistrar::executor(n), startingBlock);

auto const& l = _precompiled.at("linear").get_obj();
unsigned base = toUnsigned(l.at("base"));
unsigned word = toUnsigned(l.at("word"));
return PrecompiledContract(base, word, PrecompiledRegistrar::executor(n), startingBlock);
}
catch (PricerNotFound const&)
{
cwarn << "Couldn't create a precompiled contract account. Missing a pricer called:" << n;
throw;
}
catch (ExecutorNotFound const&)
{
// Oh dear - missing a plugin?
cwarn << "Couldn't create a precompiled contract account. Missing an executor called:" << n;
throw;
}
}
catch (PricerNotFound const&)
{
cwarn << "Couldn't create a precompiled contract account. Missing a pricer called:" << n;
throw;
}
catch (ExecutorNotFound const&)
{
// Oh dear - missing a plugin?
cwarn << "Couldn't create a precompiled contract account. Missing an executor called:" << n;
throw;
}
}
}

Expand Down
Loading