mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Specify namespaces
Fix references into solidity::util
This commit is contained in:
@@ -70,10 +70,10 @@ SemanticTest::SemanticTest(
|
||||
static set<string> const legacyRunTriggers{"also", "false", "default"};
|
||||
|
||||
string compileViaYul = m_reader.stringSetting("compileViaYul", "default");
|
||||
if (!contains(compileViaYulAllowedValues, compileViaYul))
|
||||
if (!util::contains(compileViaYulAllowedValues, compileViaYul))
|
||||
BOOST_THROW_EXCEPTION(runtime_error("Invalid compileViaYul value: " + compileViaYul + "."));
|
||||
m_testCaseWantsYulRun = contains(yulRunTriggers, compileViaYul);
|
||||
m_testCaseWantsLegacyRun = contains(legacyRunTriggers, compileViaYul);
|
||||
m_testCaseWantsYulRun = util::contains(yulRunTriggers, compileViaYul);
|
||||
m_testCaseWantsLegacyRun = util::contains(legacyRunTriggers, compileViaYul);
|
||||
|
||||
// Do not enforce via yul and ewasm, if via yul was explicitly denied.
|
||||
if (compileViaYul == "false")
|
||||
@@ -189,7 +189,7 @@ vector<SideEffectHook> SemanticTest::makeSideEffectHooks() const
|
||||
{
|
||||
vector<string> result;
|
||||
for (auto const& argument: _call.arguments.parameters)
|
||||
result.emplace_back(toHex(argument.rawBytes));
|
||||
result.emplace_back(util::toHex(argument.rawBytes));
|
||||
return result;
|
||||
}
|
||||
return {};
|
||||
|
||||
@@ -4074,12 +4074,12 @@ BOOST_AUTO_TEST_CASE(strip_reason_strings)
|
||||
m_optimiserSettings == OptimiserSettings::none()
|
||||
)
|
||||
// check that the reason string IS part of the binary.
|
||||
BOOST_CHECK(toHex(m_output).find("736f6d6520726561736f6e") != std::string::npos);
|
||||
BOOST_CHECK(util::toHex(m_output).find("736f6d6520726561736f6e") != std::string::npos);
|
||||
|
||||
m_revertStrings = RevertStrings::Strip;
|
||||
compileAndRun(sourceCode, 0, "C");
|
||||
// check that the reason string is NOT part of the binary.
|
||||
BOOST_CHECK(toHex(m_output).find("736f6d6520726561736f6e") == std::string::npos);
|
||||
BOOST_CHECK(util::toHex(m_output).find("736f6d6520726561736f6e") == std::string::npos);
|
||||
|
||||
ABI_CHECK(callContractFunction("f(bool)", true), encodeArgs(7));
|
||||
ABI_CHECK(callContractFunction("f(bool)", false), encodeArgs());
|
||||
|
||||
@@ -350,7 +350,7 @@ BOOST_AUTO_TEST_CASE(arithmetic)
|
||||
uint8_t(Instruction::JUMPDEST),
|
||||
uint8_t(Instruction::PUSH32)
|
||||
} +
|
||||
fromHex("4E487B7100000000000000000000000000000000000000000000000000000000") +
|
||||
util::fromHex("4E487B7100000000000000000000000000000000000000000000000000000000") +
|
||||
bytes{
|
||||
uint8_t(Instruction::PUSH1), 0x0,
|
||||
uint8_t(Instruction::MSTORE),
|
||||
|
||||
@@ -98,8 +98,8 @@ public:
|
||||
BOOST_CHECK_MESSAGE(!optimizedOutput.empty(), "No optimized output for " + _sig);
|
||||
BOOST_CHECK_MESSAGE(!nonOptimizedOutput.empty(), "No un-optimized output for " + _sig);
|
||||
BOOST_CHECK_MESSAGE(nonOptimizedOutput == optimizedOutput, "Computed values do not match."
|
||||
"\nNon-Optimized: " + toHex(nonOptimizedOutput) +
|
||||
"\nOptimized: " + toHex(optimizedOutput));
|
||||
"\nNon-Optimized: " + util::toHex(nonOptimizedOutput) +
|
||||
"\nOptimized: " + util::toHex(optimizedOutput));
|
||||
}
|
||||
|
||||
/// @returns the number of instructions in the given bytecode, not taking the metadata hash
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::langutil;
|
||||
using namespace solidity::frontend;
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ string BytesUtils::formatString(bytes const& _bytes, size_t _cutOff)
|
||||
if (isprint(v))
|
||||
os << v;
|
||||
else
|
||||
os << "\\x" << toHex(v, HexCase::Lower);
|
||||
os << "\\x" << util::toHex(v, HexCase::Lower);
|
||||
}
|
||||
}
|
||||
os << "\"";
|
||||
|
||||
@@ -324,7 +324,7 @@ string TestFunctionCall::formatRawParameters(
|
||||
for (auto const c: param.rawString)
|
||||
// NOTE: Even though we have a toHex() overload specifically for uint8_t, the compiler
|
||||
// chooses the one for bytes if the second argument is omitted.
|
||||
os << (c >= ' ' ? string(1, c) : "\\x" + toHex(static_cast<uint8_t>(c), HexCase::Lower));
|
||||
os << (c >= ' ' ? string(1, c) : "\\x" + util::toHex(static_cast<uint8_t>(c), HexCase::Lower));
|
||||
if (¶m != &_params.back())
|
||||
os << ", ";
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
using namespace std;
|
||||
using namespace solidity::frontend;
|
||||
using namespace solidity::test;
|
||||
using namespace solidity::util;
|
||||
|
||||
using PathSet = set<boost::filesystem::path>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user