Merge pull request #293 from MaxMustermann2/muldefs

build: remove multiple definitions error
pull/294/head
Soph 2 years ago committed by GitHub
commit 4409ecfa78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Makefile
  2. 2
      go.mod
  3. 2
      go.sum
  4. 8
      pkg/ledger/nano_S_driver.go

@ -25,7 +25,7 @@ all:
static:
make -C $(shell go env GOPATH)/src/github.com/harmony-one/mcl
make -C $(shell go env GOPATH)/src/github.com/harmony-one/bls minimised_static BLS_SWAP_G=1
source $(shell go env GOPATH)/src/github.com/harmony-one/harmony/scripts/setup_bls_build_flags.sh && $(env) go build -o $(cli) -ldflags="$(ldflags) -w -extldflags \"-static -z muldefs\"" cmd/main.go
source $(shell go env GOPATH)/src/github.com/harmony-one/harmony/scripts/setup_bls_build_flags.sh && $(env) go build -o $(cli) -ldflags="$(ldflags) -w -extldflags \"-static\"" cmd/main.go
cp $(cli) hmy
debug:

@ -14,7 +14,7 @@ require (
github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 // indirect
github.com/harmony-one/bls v0.0.7-0.20191214005344-88c23f91a8a9
github.com/harmony-one/harmony v1.10.2-0.20210123081216-6993b9ad0ca1
github.com/karalabe/hid v1.0.0
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356
github.com/mattn/go-colorable v0.1.9
github.com/mitchellh/go-homedir v1.1.0
github.com/olekukonko/tablewriter v0.0.5 // indirect

@ -471,8 +471,6 @@ github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0=
github.com/karalabe/hid v1.0.0 h1:+/CIMNXhSU/zIJgnIvBD2nKHxS/bnRHhhs9xBryLpPo=
github.com/karalabe/hid v1.0.0/go.mod h1:Vr51f8rUOLYrfrWDFlV12GGQgM5AT8sVh+2fY4MPeu8=
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw=
github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=

@ -6,8 +6,9 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/karalabe/hid"
"io"
hid "github.com/karalabe/usb"
)
const (
@ -262,7 +263,10 @@ func OpenNanoS() (*NanoS, error) {
)
// search for Nano S
devices := hid.Enumerate(ledgerVendorID, ledgerNanoSProductID)
devices, err := hid.Enumerate(ledgerVendorID, ledgerNanoSProductID)
if err != nil {
return nil, err
}
if len(devices) == 0 {
return nil, errors.New("Nano S not detected")
} else if len(devices) > 1 {

Loading…
Cancel
Save