OpenBazaar/spvwallet

../../api/rpc.go:557:36: cannot use tx.Txid (type string) as type []byte in argument to hex.EncodeToString

pmitchev opened this issue · 3 comments

x:spvwallet ob$ go version
go version go1.9.2 darwin/amd64
x:spvwallet ob$ make install
cd cmd/spvwallet && go install

github.com/OpenBazaar/spvwallet/api

../../api/rpc.go:557:36: cannot use tx.Txid (type string) as type []byte in argument to hex.EncodeToString
make: *** [install] Error 2

Same error on 1.10.3

@pmitchev Ran into the same issue, using 1.10.1 and 1.9.1 . This bug baffles me for the following reasons

  • Travis Build succeeds (using 1.9)
  • File has not been edited in 10 months,

However, the error seems to indicate that we are trying to convert something to string that already is a string, so I just removed the call to hex.EncodeToString manually, and then it built successfully. Haven't kicked all the tires, but client seems to be running fine.

Just change this line:
https://github.com/OpenBazaar/spvwallet/blob/master/api/rpc.go#L557

to this:
Txid: hex.EncodeToString([]byte(tx.Txid)),