diff --git a/internal/node/advancer/machines/machines.go b/internal/node/advancer/machines/machines.go index a60bd740c..00d35fb8d 100644 --- a/internal/node/advancer/machines/machines.go +++ b/internal/node/advancer/machines/machines.go @@ -60,19 +60,19 @@ func Load(ctx context.Context, config config.NodeConfig, repo Repository) (*Mach address, err := cartesimachine.StartServer(serverVerbosity, 0, os.Stdout, os.Stderr) if err != nil { - return nil, close(machines) + return nil, closeMachines(machines) } config := &emulator.MachineRuntimeConfig{} cartesiMachine, err := cartesimachine.Load(ctx, snapshotPath, address, config) if err != nil { - err = errors.Join(err, cartesimachine.StopServer(address), close(machines)) + err = errors.Join(err, cartesimachine.StopServer(address), closeMachines(machines)) return nil, err } rollupsMachine, err := rollupsmachine.New(ctx, cartesiMachine, machineInc, machineMax) if err != nil { - err = errors.Join(err, cartesiMachine.Close(ctx), close(machines)) + err = errors.Join(err, cartesiMachine.Close(ctx), closeMachines(machines)) return nil, err } @@ -82,7 +82,7 @@ func Load(ctx context.Context, config config.NodeConfig, repo Repository) (*Mach machineInspectTimeout, maxConcurrentInspects) if err != nil { - err = errors.Join(err, rollupsMachine.Close(ctx), close(machines)) + err = errors.Join(err, rollupsMachine.Close(ctx), closeMachines(machines)) return nil, err } @@ -141,7 +141,7 @@ func (m *Machines) Close() error { m.mutex.Lock() defer m.mutex.Unlock() - err := close(m.machines) + err := closeMachines(m.machines) if err != nil { slog.Error(fmt.Sprintf("failed to close some machines: %v", err)) } @@ -156,7 +156,7 @@ func (m *Machines) get(app model.Address) *nodemachine.NodeMachine { return m.machines[app] } -func close(machines map[model.Address]*nodemachine.NodeMachine) (err error) { +func closeMachines(machines map[model.Address]*nodemachine.NodeMachine) (err error) { for _, machine := range machines { err = errors.Join(err, machine.Close()) } diff --git a/pkg/rollupsmachine/machine_test.go b/pkg/rollupsmachine/machine_test.go index d25b7edc6..c430b51f8 100644 --- a/pkg/rollupsmachine/machine_test.go +++ b/pkg/rollupsmachine/machine_test.go @@ -13,7 +13,7 @@ import ( "github.com/cartesi/rollups-node/pkg/emulator" "github.com/cartesi/rollups-node/pkg/rollupsmachine/cartesimachine" - "github.com/cartesi/rollups-node/test/snapshot" + "github.com/cartesi/rollups-node/test/tooling/snapshot" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/test/snapshot/snapshot.go b/test/tooling/snapshot/snapshot.go similarity index 100% rename from test/snapshot/snapshot.go rename to test/tooling/snapshot/snapshot.go