aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/GasMeter.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-09-18 22:46:15 +0800
committerGitHub <noreply@github.com>2018-09-18 22:46:15 +0800
commitc42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519 (patch)
tree2530a0d9fac8acdc9833504db94b9b1aa570d39a /libevmasm/GasMeter.h
parent48a3fe204f0e0865fb8f85349f196299c40b79ca (diff)
parent0b68d093b45b71bf976f8cf37a6b917aa29ac4e3 (diff)
downloaddexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.tar
dexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.tar.gz
dexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.tar.bz2
dexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.tar.lz
dexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.tar.xz
dexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.tar.zst
dexon-solidity-c42dfc5b1083a0d49c64a6e3cbe2d3f220d1f519.zip
Merge pull request #4967 from ethereum/const-opt-cost
Move dataGas calculation helper to GasMeter
Diffstat (limited to 'libevmasm/GasMeter.h')
-rw-r--r--libevmasm/GasMeter.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h
index fc3740d2..7cb8015f 100644
--- a/libevmasm/GasMeter.h
+++ b/libevmasm/GasMeter.h
@@ -136,6 +136,9 @@ public:
/// change with EVM versions)
static unsigned runGas(Instruction _instruction);
+ /// @returns the gas cost of the supplied data, depending whether it is in creation code, or not.
+ static u256 dataGas(bytes const& _data, bool _inCreation);
+
private:
/// @returns _multiplier * (_value + 31) / 32, if _value is a known constant and infinite otherwise.
GasConsumption wordGas(u256 const& _multiplier, ExpressionClasses::Id _value);