Skip to content

Commit

Permalink
Replacing deprecated function toECDSAPub
Browse files Browse the repository at this point in the history
- Replaced crypto.toECDSAPub with crypto.UnmarshalPubKey, based on ethereum/go-ethereum#16932
- Skipping failing test (test token isn't in live results).
  • Loading branch information
MathieuGilbert committed Aug 8, 2018
1 parent c7cbd15 commit 6c86b9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion etherdelta.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,10 @@ func (s *Service) MakeOrder(opts *MakeOrderOpts) (string, error) {
return result, fmt.Errorf("ECRecover error: %s", err)
}

pubKey := crypto.ToECDSAPub(recoveredPub)
pubKey, err := crypto.UnmarshalPubkey(recoveredPub)
if err != nil {
return result, fmt.Errorf("Invalid public key: %x", recoveredPub)
}
recoveredAddr := crypto.PubkeyToAddress(*pubKey)
addr := common.HexToAddress(opts.UserAddress)

Expand Down
4 changes: 2 additions & 2 deletions etherdelta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestGetTokenTicker(t *testing.T) {
}

func TestGetTokenPrice(t *testing.T) {
//t.Skip("Skipping GetTokenPrice")
t.Skip("Skipping GetTokenPrice")
getTokenPriceOpts := &GetTokenPriceOpts{
TokenSymbol: "BAT",
}
Expand Down Expand Up @@ -518,7 +518,7 @@ func TestSignature(t *testing.T) {
}

recoveredPub, err := crypto.Ecrecover(msg, sig)
pubKey := crypto.ToECDSAPub(recoveredPub)
pubKey, _ := crypto.UnmarshalPubkey(recoveredPub)
recoveredAddr := crypto.PubkeyToAddress(*pubKey)

addr := common.HexToAddress(orderPost.User)
Expand Down

0 comments on commit 6c86b9e

Please sign in to comment.