-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
signature_data.go
36 lines (28 loc) · 1.08 KB
/
signature_data.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
package signing
import (
"github.com/cosmos/cosmos-sdk/crypto/types"
)
// SignatureData represents either a *SingleSignatureData or *MultiSignatureData.
// It is a convenience type that is easier to use in business logic than the encoded
// protobuf ModeInfo's and raw signatures.
type SignatureData interface {
isSignatureData()
}
// SingleSignatureData represents the signature and SignMode of a single (non-multisig) signer
type SingleSignatureData struct {
// SignMode represents the SignMode of the signature
SignMode SignMode
// Signature is the raw signature.
Signature []byte
}
// MultiSignatureData represents the nested SignatureData of a multisig signature
type MultiSignatureData struct {
// BitArray is a compact way of indicating which signers from the multisig key
// have signed
BitArray *types.CompactBitArray
// Signatures is the nested SignatureData's for each signer
Signatures []SignatureData
}
var _, _ SignatureData = &SingleSignatureData{}, &MultiSignatureData{}
func (m *SingleSignatureData) isSignatureData() {}
func (m *MultiSignatureData) isSignatureData() {}