diff --git a/go.mod b/go.mod index b4eb9d5..260ada5 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/Snider/Borg v0.0.2 github.com/Snider/Poindexter v0.0.0-20251229183216-e182d4f49741 github.com/adrg/xdg v0.5.3 + github.com/ckanthony/gin-mcp v0.0.0-20251107113615-3c631c4fa9f4 github.com/gin-contrib/cors v1.7.6 github.com/gin-gonic/gin v1.11.0 github.com/google/uuid v1.6.0 @@ -17,6 +18,7 @@ require ( github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 github.com/swaggo/swag v1.16.6 + golang.org/x/text v0.31.0 ) require ( @@ -25,7 +27,6 @@ require ( github.com/Snider/Enchantrix v0.0.2 // indirect github.com/bytedance/sonic v1.14.0 // indirect github.com/bytedance/sonic/loader v0.3.0 // indirect - github.com/ckanthony/gin-mcp v0.0.0-20251107113615-3c631c4fa9f4 // indirect github.com/cloudflare/circl v1.6.1 // indirect github.com/cloudwego/base64x v0.1.6 // indirect github.com/ebitengine/purego v0.9.0 // indirect @@ -70,11 +71,10 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/arch v0.20.0 // indirect golang.org/x/crypto v0.45.0 // indirect - golang.org/x/mod v0.29.0 // indirect + golang.org/x/mod v0.30.0 // indirect golang.org/x/net v0.47.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect golang.org/x/tools v0.38.0 // indirect google.golang.org/protobuf v1.36.9 // indirect ) diff --git a/pkg/mining/manager_test.go b/pkg/mining/manager_test.go index d67af03..3ee1a96 100644 --- a/pkg/mining/manager_test.go +++ b/pkg/mining/manager_test.go @@ -6,7 +6,6 @@ import ( "path/filepath" "runtime" "testing" - "time" ) // setupTestManager creates a new Manager and a dummy executable for tests. @@ -133,8 +132,9 @@ func TestListMiners_Good(t *testing.T) { m.miners["xmrig-test"] = miner m.mu.Unlock() - miners = m.ListMiners() - if len(miners) != 1 { - t.Errorf("Expected 1 miner, but got %d", len(miners)) + finalMiners := m.ListMiners() + expectedCount := initialCount + 1 + if len(finalMiners) != expectedCount { + t.Errorf("Expected %d miners, but got %d", expectedCount, len(finalMiners)) } } diff --git a/pkg/mining/mining_test.go b/pkg/mining/mining_test.go index 57c158e..4a3ce9e 100644 --- a/pkg/mining/mining_test.go +++ b/pkg/mining/mining_test.go @@ -1,7 +1,6 @@ package mining import ( - "context" "testing" ) diff --git a/pkg/mining/xmrig_test.go b/pkg/mining/xmrig_test.go index 45ea212..21d88c5 100644 --- a/pkg/mining/xmrig_test.go +++ b/pkg/mining/xmrig_test.go @@ -119,11 +119,14 @@ func TestXMRigMiner_Start_Stop_Bad(t *testing.T) { func TestXMRigMiner_CheckInstallation(t *testing.T) { tmpDir := t.TempDir() - dummyExePath := filepath.Join(tmpDir, "xmrig") - executableName := "xmrig" + // Use "miner" since that's what NewXMRigMiner() sets as ExecutableName + executableName := "miner" if runtime.GOOS == "windows" { executableName += ".exe" - dummyExePath = filepath.Join(tmpDir, executableName) + } + dummyExePath := filepath.Join(tmpDir, executableName) + + if runtime.GOOS == "windows" { // Create a dummy batch file that prints version if err := os.WriteFile(dummyExePath, []byte("@echo off\necho XMRig 6.24.0\n"), 0755); err != nil { t.Fatalf("failed to create dummy executable: %v", err) diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 0d76eaf..06f1fd2 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -10,7 +10,6 @@ import ( "time" "github.com/Snider/Mining/pkg/logging" - "github.com/Snider/Mining/pkg/ueps" "github.com/Snider/Poindexter" "github.com/adrg/xdg" )