From d37f987639c7a3a8af3a81989d5152a3fca11c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 16 Jan 2019 11:43:41 +0100 Subject: [PATCH] cmd/evm: Add --vm.evm flag to support EVMC (#18457) --- cmd/evm/main.go | 6 ++++++ cmd/evm/runner.go | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/evm/main.go b/cmd/evm/main.go index a59cb1fb84..ebac2047aa 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -110,6 +110,11 @@ var ( Name: "nostack", Usage: "disable stack output", } + EVMInterpreterFlag = cli.StringFlag{ + Name: "vm.evm", + Usage: "External EVM configuration (default = built-in interpreter)", + Value: "", + } ) func init() { @@ -133,6 +138,7 @@ func init() { ReceiverFlag, DisableMemoryFlag, DisableStackFlag, + EVMInterpreterFlag, } app.Commands = []cli.Command{ compileCommand, diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 54b67ce101..c732c8b574 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -171,8 +171,9 @@ func runCmd(ctx *cli.Context) error { Coinbase: genesisConfig.Coinbase, BlockNumber: new(big.Int).SetUint64(genesisConfig.Number), EVMConfig: vm.Config{ - Tracer: tracer, - Debug: ctx.GlobalBool(DebugFlag.Name) || ctx.GlobalBool(MachineFlag.Name), + Tracer: tracer, + Debug: ctx.GlobalBool(DebugFlag.Name) || ctx.GlobalBool(MachineFlag.Name), + EVMInterpreter: ctx.GlobalString(EVMInterpreterFlag.Name), }, }