aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-04 17:33:16 +0800
committerGitHub <noreply@github.com>2017-10-04 17:33:16 +0800
commit30908415bfdb463adafc4aabab48cbe56d105012 (patch)
tree6c4336886b658b762301222c38247089ea682d5e /test
parent0c3888aba263fe89110c6197fe3e74e4c8176624 (diff)
parent4d1c48eeee8a0b71b79ce51a811e8f1f3e2388d6 (diff)
downloaddexon-solidity-30908415bfdb463adafc4aabab48cbe56d105012.tar.gz
dexon-solidity-30908415bfdb463adafc4aabab48cbe56d105012.tar.zst
dexon-solidity-30908415bfdb463adafc4aabab48cbe56d105012.zip
Merge pull request #3013 from ethereum/evmasm-cleanup
Cleanup instruction / gasmeter
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/GasMeter.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index b759678f..c2886f5b 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -21,7 +21,6 @@
*/
#include <test/libsolidity/SolidityExecutionFramework.h>
-#include <libevmasm/EVMSchedule.h>
#include <libevmasm/GasMeter.h>
#include <libevmasm/KnownState.h>
#include <libevmasm/PathGasMeter.h>
@@ -63,15 +62,13 @@ public:
void testCreationTimeGas(string const& _sourceCode)
{
- EVMSchedule schedule;
-
compileAndRun(_sourceCode);
auto state = make_shared<KnownState>();
PathGasMeter meter(*m_compiler.assemblyItems());
GasMeter::GasConsumption gas = meter.estimateMax(0, state);
u256 bytecodeSize(m_compiler.runtimeObject().bytecode.size());
// costs for deployment
- gas += bytecodeSize * schedule.createDataGas;
+ gas += bytecodeSize * GasCosts::createDataGas;
// costs for transaction
gas += gasForTransaction(m_compiler.object().bytecode, true);
@@ -103,10 +100,9 @@ public:
static GasMeter::GasConsumption gasForTransaction(bytes const& _data, bool _isCreation)
{
- EVMSchedule schedule;
- GasMeter::GasConsumption gas = _isCreation ? schedule.txCreateGas : schedule.txGas;
+ GasMeter::GasConsumption gas = _isCreation ? GasCosts::txCreateGas : GasCosts::txGas;
for (auto i: _data)
- gas += i != 0 ? schedule.txDataNonZeroGas : schedule.txDataZeroGas;
+ gas += i != 0 ? GasCosts::txDataNonZeroGas : GasCosts::txDataZeroGas;
return gas;
}