mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Transition from bytecode to more general linker objects.
This commit is contained in:
@@ -233,7 +233,7 @@ protected:
|
||||
m_compiler.reset(false, m_addStandardSources);
|
||||
m_compiler.addSource("", registrarCode);
|
||||
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed");
|
||||
s_compiledRegistrar.reset(new bytes(m_compiler.bytecode("GlobalRegistrar")));
|
||||
s_compiledRegistrar.reset(new bytes(m_compiler.object("GlobalRegistrar").bytecode));
|
||||
}
|
||||
sendMessage(*s_compiledRegistrar, true);
|
||||
BOOST_REQUIRE(!m_output.empty());
|
||||
|
||||
@@ -125,7 +125,7 @@ protected:
|
||||
m_compiler.reset(false, m_addStandardSources);
|
||||
m_compiler.addSource("", registrarCode);
|
||||
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed");
|
||||
s_compiledRegistrar.reset(new bytes(m_compiler.bytecode("FixedFeeRegistrar")));
|
||||
s_compiledRegistrar.reset(new bytes(m_compiler.object("FixedFeeRegistrar").bytecode));
|
||||
}
|
||||
sendMessage(*s_compiledRegistrar, true);
|
||||
BOOST_REQUIRE(!m_output.empty());
|
||||
|
||||
@@ -440,7 +440,7 @@ protected:
|
||||
m_compiler.reset(false, m_addStandardSources);
|
||||
m_compiler.addSource("", walletCode);
|
||||
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed");
|
||||
s_compiledWallet.reset(new bytes(m_compiler.bytecode("Wallet")));
|
||||
s_compiledWallet.reset(new bytes(m_compiler.object("Wallet").bytecode));
|
||||
}
|
||||
bytes args = encodeArgs(u256(0x60), _required, _dailyLimit, u256(_owners.size()), _owners);
|
||||
sendMessage(*s_compiledWallet + args, true, _value);
|
||||
|
||||
@@ -66,7 +66,7 @@ eth::AssemblyItems compileContract(const string& _sourceCode)
|
||||
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
|
||||
{
|
||||
Compiler compiler;
|
||||
compiler.compileContract(*contract, map<ContractDefinition const*, bytes const*>{});
|
||||
compiler.compileContract(*contract, map<ContractDefinition const*, Assembly const*>{});
|
||||
|
||||
return compiler.runtimeAssemblyItems();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
auto state = make_shared<KnownState>();
|
||||
PathGasMeter meter(*m_compiler.assemblyItems());
|
||||
GasMeter::GasConsumption gas = meter.estimateMax(0, state);
|
||||
u256 bytecodeSize(m_compiler.runtimeBytecode().size());
|
||||
u256 bytecodeSize(m_compiler.runtimeObject().bytecode.size());
|
||||
gas += bytecodeSize * c_createDataGas;
|
||||
BOOST_REQUIRE(!gas.isInfinite);
|
||||
BOOST_CHECK(gas.value == m_gasUsed);
|
||||
|
||||
@@ -138,7 +138,7 @@ bytes compileFirstExpression(const string& _sourceCode, vector<vector<string>> _
|
||||
|
||||
for (vector<string> const& function: _functions)
|
||||
context << context.functionEntryLabel(dynamic_cast<FunctionDefinition const&>(resolveDeclaration(function, resolver)));
|
||||
bytes instructions = context.assembledBytecode();
|
||||
bytes instructions = context.assembledObject().bytecode;
|
||||
// debug
|
||||
// cout << eth::disassemble(instructions) << endl;
|
||||
return instructions;
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
m_compiler.reset(false, m_addStandardSources);
|
||||
m_compiler.addSource("", _sourceCode);
|
||||
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed");
|
||||
bytes code = m_compiler.bytecode(_contractName);
|
||||
bytes code = m_compiler.object(_contractName).bytecode;
|
||||
sendMessage(code + _arguments, true, _value);
|
||||
return m_output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user