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 c0c52da
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions swap/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ package swap

import (
"context"
"encoding/hex"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"runtime"
"testing"
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
Expand Down Expand Up @@ -317,6 +320,12 @@ func TestSwapRPC(t *testing.T) {
swap, clean := newTestSwap(t, ownerKey)
defer clean()

// use unique IPC path on windows
if runtime.GOOS == "windows" {
pubCompressed := hex.EncodeToString(crypto.CompressPubkey(swap.owner.publicKey))
ipcPath = fmt.Sprintf(`\\.\pipe\swap-%x`, pubCompressed)
}

// need to have a dummy contract or the call will fail at `GetParams` due to `NewAPI`
swap.contract, err = contract.InstanceAt(common.Address{}, swap.backend)
if err != nil {
Expand Down

0 comments on commit c0c52da

Please sign in to comment.