Commit 2bdb8182 authored by ControlCplusControlV's avatar ControlCplusControlV Committed by GitHub

open up anvil args (#13320)

Co-authored-by: default avatarMatthew Slipper <me@matthewslipper.com>
parent 70e71c23
...@@ -33,18 +33,21 @@ type Runner struct { ...@@ -33,18 +33,21 @@ type Runner struct {
} }
func New(l1RPCURL string, logger log.Logger) (*Runner, error) { func New(l1RPCURL string, logger log.Logger) (*Runner, error) {
return NewWithOpts(l1RPCURL, "1000000000", logger)
}
func NewWithOpts(l1RPCURL string, baseFee string, logger log.Logger) (*Runner, error) {
if _, err := exec.LookPath("anvil"); err != nil { if _, err := exec.LookPath("anvil"); err != nil {
return nil, fmt.Errorf("anvil not found in PATH: %w", err) return nil, fmt.Errorf("anvil not found in PATH: %w", err)
} }
proc := exec.Command( args := []string{"--port", "0", "--base-fee", baseFee}
"anvil", if l1RPCURL != "" {
"--fork-url", l1RPCURL, args = append([]string{"--fork-url", l1RPCURL}, args...)
"--port", }
"0",
"--base-fee", proc := exec.Command("anvil", args...)
"1000000000",
)
stdout, err := proc.StdoutPipe() stdout, err := proc.StdoutPipe()
if err != nil { if err != nil {
return nil, err return nil, err
......
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