mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
added option to set initial gas
This commit is contained in:
parent
fc7a46baf2
commit
d41828fee1
1 changed files with 8 additions and 2 deletions
|
|
@ -25,7 +25,6 @@ void show_usage()
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string input_file;
|
std::string input_file;
|
||||||
bool opt_dissassemble = false;
|
bool opt_dissassemble = false;
|
||||||
bool opt_show_bytes = false;
|
bool opt_show_bytes = false;
|
||||||
|
|
@ -33,6 +32,7 @@ int main(int argc, char** argv)
|
||||||
bool opt_interpret = false;
|
bool opt_interpret = false;
|
||||||
bool opt_dump_graph = false;
|
bool opt_dump_graph = false;
|
||||||
bool opt_unknown = false;
|
bool opt_unknown = false;
|
||||||
|
size_t initialGas = 10000;
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++)
|
for (int i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -47,6 +47,12 @@ int main(int argc, char** argv)
|
||||||
opt_interpret = true;
|
opt_interpret = true;
|
||||||
else if (option == "-g")
|
else if (option == "-g")
|
||||||
opt_dump_graph = true;
|
opt_dump_graph = true;
|
||||||
|
else if (option == "-G" && i + 1 < argc)
|
||||||
|
{
|
||||||
|
std::string gasValue = argv[++i];
|
||||||
|
initialGas = boost::lexical_cast<size_t>(gasValue);
|
||||||
|
std::cerr << "Initial gas set to " << initialGas << "\n";
|
||||||
|
}
|
||||||
else if (option[0] != '-' && input_file.empty())
|
else if (option[0] != '-' && input_file.empty())
|
||||||
input_file = option;
|
input_file = option;
|
||||||
else
|
else
|
||||||
|
|
@ -109,7 +115,7 @@ int main(int argc, char** argv)
|
||||||
if (opt_interpret)
|
if (opt_interpret)
|
||||||
{
|
{
|
||||||
auto engine = eth::jit::ExecutionEngine();
|
auto engine = eth::jit::ExecutionEngine();
|
||||||
u256 gas = 10000;
|
u256 gas = initialGas;
|
||||||
auto result = engine.run(std::move(module), gas);
|
auto result = engine.run(std::move(module), gas);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue