-
Notifications
You must be signed in to change notification settings - Fork 1
/
configtx.go
69 lines (37 loc) · 1.03 KB
/
configtx.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package configtx
import (
cb "github.com/mcc-github/blockchain-protos-go/common"
)
type Validator struct {
ChannelIDVal string
SequenceVal uint64
ApplyVal error
AppliedConfigUpdateEnvelope *cb.ConfigEnvelope
ValidateVal error
ProposeConfigUpdateError error
ProposeConfigUpdateVal *cb.ConfigEnvelope
ConfigProtoVal *cb.Config
}
func (cm *Validator) ConfigProto() *cb.Config {
return cm.ConfigProtoVal
}
func (cm *Validator) ChannelID() string {
return cm.ChannelIDVal
}
func (cm *Validator) Sequence() uint64 {
return cm.SequenceVal
}
func (cm *Validator) ProposeConfigUpdate(update *cb.Envelope) (*cb.ConfigEnvelope, error) {
return cm.ProposeConfigUpdateVal, cm.ProposeConfigUpdateError
}
func (cm *Validator) Apply(configEnv *cb.ConfigEnvelope) error {
cm.AppliedConfigUpdateEnvelope = configEnv
return cm.ApplyVal
}
func (cm *Validator) Validate(configEnv *cb.ConfigEnvelope) error {
return cm.ValidateVal
}