Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
gas_tracker.hpp
Go to the documentation of this file.
1#pragma once
2
9
10namespace bb::avm2::simulation {
11
13 public:
14 virtual ~GasTrackerInterface() = default;
15 // @throws OutOfGasException.
16 virtual void consume_gas(const Gas& dynamic_gas_factor = { 0, 0 }) = 0;
17
18 virtual Gas compute_gas_limit_for_call(const Gas& allocated_gas) = 0;
19};
20
21class GasTracker final : public GasTrackerInterface {
22 public:
28
29 void consume_gas(const Gas& dynamic_gas_factor = { 0, 0 }) override;
30 Gas compute_gas_limit_for_call(const Gas& allocated_gas) override;
31
32 private:
37};
38
39} // namespace bb::avm2::simulation
Gas compute_gas_limit_for_call(const Gas &allocated_gas) override
const ExecInstructionSpec & spec
void consume_gas(const Gas &dynamic_gas_factor={ 0, 0 }) override
RangeCheckInterface & range_check
virtual void consume_gas(const Gas &dynamic_gas_factor={ 0, 0 })=0
virtual Gas compute_gas_limit_for_call(const Gas &allocated_gas)=0
InstructionInfoDB instruction_info_db
Instruction instruction