-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathtypes.go
43 lines (37 loc) · 1.13 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package types
import (
proto "github.com/gogo/protobuf/proto"
tmcrypto "github.com/tendermint/tendermint/crypto"
)
// PubKey defines a public key and extends proto.Message.
type PubKey interface {
proto.Message
Address() Address
Bytes() []byte
VerifySignature(msg []byte, sig []byte) bool
Equals(PubKey) bool
Type() string
}
// LedgerPrivKey defines a private key that is not a proto message. For now,
// LedgerSecp256k1 keys are not converted to proto.Message yet, this is why
// they use LedgerPrivKey instead of PrivKey. All other keys must use PrivKey
// instead of LedgerPrivKey.
// TODO https://github.com/cosmos/cosmos-sdk/issues/7357.
type LedgerPrivKey interface {
Bytes() []byte
Sign(msg []byte) ([]byte, error)
PubKey() PubKey
Equals(LedgerPrivKey) bool
Type() string
}
// PrivKey defines a private key and extends proto.Message. For now, it extends
// LedgerPrivKey (see godoc for LedgerPrivKey). Ultimately, we should remove
// LedgerPrivKey and add its methods here directly.
// TODO https://github.com/cosmos/cosmos-sdk/issues/7357.
type PrivKey interface {
proto.Message
LedgerPrivKey
}
type (
Address = tmcrypto.Address
)