-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfig_wrapper.hpp
87 lines (62 loc) · 2.71 KB
/
config_wrapper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#include <evm_runtime/tables.hpp>
#include <eosio/asset.hpp>
#include <eosio/time.hpp>
#include <eosio/singleton.hpp>
namespace evm_runtime {
struct fee_parameters;
struct config_wrapper {
config_wrapper(eosio::name self);
~config_wrapper();
void flush();
bool exists();
eosio::unsigned_int get_version()const;
void set_version(const eosio::unsigned_int version);
uint64_t get_chainid()const;
void set_chainid(uint64_t chainid);
const eosio::time_point_sec& get_genesis_time()const;
void set_genesis_time(eosio::time_point_sec genesis_time);
const eosio::asset& get_ingress_bridge_fee()const;
void set_ingress_bridge_fee(const eosio::asset& ingress_bridge_fee);
gas_prices_type get_gas_prices()const;
void set_gas_prices(const gas_prices_type& price);
uint64_t get_gas_price()const;
void set_gas_price(uint64_t gas_price);
template <typename Q, typename Func>
void enqueue(Func&& update_fnc);
void enqueue_gas_price(uint64_t gas_price);
void enqueue_gas_prices(const gas_prices_type& prices);
template <typename Q, typename Func>
void process_queue(Func&& update_func);
void process_price_queue();
uint32_t get_miner_cut()const;
void set_miner_cut(uint32_t miner_cut);
uint32_t get_status()const;
void set_status(uint32_t status);
uint64_t get_evm_version()const;
uint64_t get_evm_version_and_maybe_promote();
void set_evm_version(uint64_t new_version);
void set_fee_parameters(const fee_parameters& fee_params,
bool allow_any_to_be_unspecified);
void update_consensus_parameters(eosio::asset ram_price_mb, uint64_t gas_price);
void update_consensus_parameters2(std::optional<uint64_t> gas_txnewaccount, std::optional<uint64_t> gas_newaccount, std::optional<uint64_t> gas_txcreate, std::optional<uint64_t> gas_codedeposit, std::optional<uint64_t> gas_sset);
const consensus_parameter_data_type& get_consensus_param();
std::pair<const consensus_parameter_data_type &, bool> get_consensus_param_and_maybe_promote();
void set_token_contract(eosio::name token_contract); // only set during init
eosio::name get_token_contract() const;
eosio::symbol get_token_symbol() const;
uint64_t get_minimum_natively_representable() const;
private:
void set_queue_front_block(uint32_t block_num);
bool is_dirty()const;
void set_dirty();
void clear_dirty();
eosio::time_point get_current_time()const;
bool _dirty = false;
bool _exists = false;
config _cached_config;
eosio::name _self;
eosio::singleton<"config"_n, config> _config;
mutable std::optional<eosio::time_point> current_time_point;
};
} //namespace evm_runtime