Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions playground/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,10 @@ func NewOutput(dst string) (*output, error) {
// Use the $HOMEDIR/devnet as the default output
dst = filepath.Join(playgroundDir, "devnet")
}
dst, err = filepath.Abs(dst)
if err != nil {
return nil, fmt.Errorf("failed to convert path %s to absolute: %w", dst, err)
}

out := &output{dst: dst, homeDir: playgroundDir}

Expand All @@ -552,10 +556,6 @@ func (o *output) Read(path string) (string, error) {
return string(data), nil
}

func (o *output) AbsoluteDstPath() (string, error) {
return filepath.Abs(o.dst)
}

func (o *output) Exists(path string) bool {
_, err := os.Stat(filepath.Join(o.dst))
return err == nil
Expand Down
8 changes: 1 addition & 7 deletions playground/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"
"github.com/flashbots/builder-playground/utils"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -224,14 +223,9 @@ func (tt *testFramework) test(component ComponentGen, args []string) *Manifest {
t.Fatal(err)
}

homeDir, err := utils.GetPlaygroundDir()
o, err := NewOutput(e2eTestDir)
require.NoError(t, err)

o := &output{
dst: e2eTestDir,
homeDir: homeDir,
}

exCtx := &ExContext{
Output: o,
LogLevel: LevelDebug,
Expand Down
5 changes: 1 addition & 4 deletions playground/local_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,7 @@ func (d *LocalRunner) toDockerComposeService(s *Service) (map[string]interface{}

// The containers have access to the full set of artifacts on the /artifacts folder
// so, we have to bind it as a volume on the container.
outputFolder, err := d.out.AbsoluteDstPath()
if err != nil {
return nil, nil, fmt.Errorf("failed to get absolute path for output folder: %w", err)
}
outputFolder := d.out.Dst()

// Validate that the image exists
imageName := fmt.Sprintf("%s:%s", s.Image, s.Tag)
Expand Down