Commit e52030db authored by clabby's avatar clabby Committed by GitHub

chore(op-challenger): Update kona native mode flag (#13023)

parent 8f5c20ee
...@@ -10,7 +10,6 @@ import ( ...@@ -10,7 +10,6 @@ import (
type KonaExecutor struct { type KonaExecutor struct {
nativeMode bool nativeMode bool
clientBinPath string
} }
var _ OracleServerExecutor = (*KonaExecutor)(nil) var _ OracleServerExecutor = (*KonaExecutor)(nil)
...@@ -19,8 +18,8 @@ func NewKonaExecutor() *KonaExecutor { ...@@ -19,8 +18,8 @@ func NewKonaExecutor() *KonaExecutor {
return &KonaExecutor{nativeMode: false} return &KonaExecutor{nativeMode: false}
} }
func NewNativeKonaExecutor(clientBinPath string) *KonaExecutor { func NewNativeKonaExecutor() *KonaExecutor {
return &KonaExecutor{nativeMode: true, clientBinPath: clientBinPath} return &KonaExecutor{nativeMode: true}
} }
func (s *KonaExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error) { func (s *KonaExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error) {
...@@ -37,7 +36,7 @@ func (s *KonaExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.Lo ...@@ -37,7 +36,7 @@ func (s *KonaExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.Lo
} }
if s.nativeMode { if s.nativeMode {
args = append(args, "--exec", s.clientBinPath) args = append(args, "--native")
} else { } else {
args = append(args, "--server") args = append(args, "--server")
args = append(args, "--data-dir", dataDir) args = append(args, "--data-dir", dataDir)
......
...@@ -16,15 +16,14 @@ import ( ...@@ -16,15 +16,14 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
var konaHostPath, konaClientPath string var konaHostPath string
func init() { func init() {
konaHostPath = os.Getenv("KONA_HOST_PATH") konaHostPath = os.Getenv("KONA_HOST_PATH")
konaClientPath = os.Getenv("KONA_CLIENT_PATH")
} }
func IsKonaConfigured() bool { func IsKonaConfigured() bool {
return konaHostPath != "" && konaClientPath != "" return konaHostPath != ""
} }
func RunKonaNative( func RunKonaNative(
...@@ -57,7 +56,7 @@ func RunKonaNative( ...@@ -57,7 +56,7 @@ func RunKonaNative(
L2Claim: fixtureInputs.L2Claim, L2Claim: fixtureInputs.L2Claim,
L2BlockNumber: big.NewInt(int64(fixtureInputs.L2BlockNumber)), L2BlockNumber: big.NewInt(int64(fixtureInputs.L2BlockNumber)),
} }
hostCmd, err := vm.NewNativeKonaExecutor(konaClientPath).OracleCommand(vmCfg, workDir, inputs) hostCmd, err := vm.NewNativeKonaExecutor().OracleCommand(vmCfg, workDir, inputs)
require.NoError(t, err) require.NoError(t, err)
cmd := exec.Command(hostCmd[0], hostCmd[1:]...) cmd := exec.Command(hostCmd[0], hostCmd[1:]...)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment