Skip to content

Commit 4c3a2c1

Browse files
Fix: lint
1 parent 0a1027d commit 4c3a2c1

File tree

5 files changed

+20
-234
lines changed

5 files changed

+20
-234
lines changed

tools/base/hashcodes.go

Lines changed: 0 additions & 219 deletions
This file was deleted.

tools/crypto/curve.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ type Curve interface {
2222
Kind() ECKind
2323
}
2424

25-
// EmptyCurve -
26-
type EmptyCurve struct {
27-
addressPrefix []byte
28-
publicKeyPrefix []byte
29-
privateKeyPrefix []byte
30-
signaturePrefix []byte
31-
seedKey []byte
32-
}
33-
3425
// NewCurve -
3526
func NewCurve(kind ECKind) (Curve, error) {
3627
switch kind {

tools/crypto/ed25519.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ import (
1010
)
1111

1212
// Ed25519 -
13-
type Ed25519 EmptyCurve
13+
type Ed25519 struct {
14+
addressPrefix []byte
15+
publicKeyPrefix []byte
16+
privateKeyPrefix []byte
17+
signaturePrefix []byte
18+
seedKey []byte
19+
}
1420

1521
// NewEd25519 -
1622
func NewEd25519() Ed25519 {

tools/crypto/key.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import (
99

1010
// Key -
1111
type Key struct {
12-
pubKey PubKey
13-
address string
14-
curve Curve
15-
bytes []byte
12+
pubKey PubKey
13+
curve Curve
14+
bytes []byte
1615
}
1716

1817
// NewKey -
@@ -120,3 +119,8 @@ func (key Key) Sign(data []byte) (Signature, error) {
120119
func (key Key) Verify(data, signature []byte) bool {
121120
return key.pubKey.Verify(data, signature)
122121
}
122+
123+
// Address -
124+
func (key Key) Address() (string, error) {
125+
return key.pubKey.Address()
126+
}

tzkt/api/api.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ func (tzkt *API) json(ctx context.Context, endpoint string, args map[string]stri
117117
case http.StatusNoContent:
118118
return nil
119119
default:
120-
return errors.New(fmt.Sprintf("%s: %s %v", resp.Status, endpoint, args))
120+
body, err := ioutil.ReadAll(resp.Body)
121+
if err != nil {
122+
return err
123+
}
124+
return errors.New(fmt.Sprintf("%s: %s %s %v", resp.Status, string(body), endpoint, args))
121125
}
122126
}
123127

0 commit comments

Comments
 (0)