Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
swap: Windows IPC
Browse files Browse the repository at this point in the history
  • Loading branch information
holisticode committed Sep 9, 2019
1 parent 413ce51 commit 5e68322
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions swap/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path/filepath"
"reflect"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -310,7 +311,7 @@ func TestTriggerDisconnectThreshold(t *testing.T) {
func TestSwapRPC(t *testing.T) {

var (
ipcPath = ".swarm.ipc"
ipcPath = ".swap.ipc"
err error
)

Expand All @@ -329,8 +330,15 @@ func TestSwapRPC(t *testing.T) {
go stack.Stop()
}()

// use unique IPC path on windows
if runtime.GOOS == "windows" {
ipcPath = `\\.\pipe\swap.ipc`
} else {
ipcPath = filepath.Join(stack.DataDir(), ipcPath)
}

// connect to the servicenode RPCs
rpcclient, err := rpc.Dial(filepath.Join(stack.DataDir(), ipcPath))
rpcclient, err := rpc.Dial(ipcPath)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 5e68322

Please sign in to comment.