@@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- package orderer
17
+ package utils
18
18
19
19
import (
20
20
cu "github.com/hyperledger/fabric/core/util"
21
21
cb "github.com/hyperledger/fabric/protos/common"
22
- "github.com/hyperledger/fabric/protos/utils "
22
+ ab "github.com/hyperledger/fabric/protos/orderer "
23
23
)
24
24
25
25
const CreationPolicyKey = "CreationPolicy"
@@ -34,25 +34,25 @@ func ChainCreationConfiguration(creationPolicy, newChainID string, template *cb.
34
34
var hashBytes []byte
35
35
36
36
for i , item := range template .Items {
37
- configItem := utils . UnmarshalConfigurationItemOrPanic (item .ConfigurationItem )
37
+ configItem := UnmarshalConfigurationItemOrPanic (item .ConfigurationItem )
38
38
configItem .Header .ChainID = newChainID
39
39
newConfigItems [i ] = & cb.SignedConfigurationItem {
40
- ConfigurationItem : utils . MarshalOrPanic (configItem ),
40
+ ConfigurationItem : MarshalOrPanic (configItem ),
41
41
}
42
42
hashBytes = append (hashBytes , newConfigItems [i ].ConfigurationItem ... )
43
43
}
44
44
45
45
digest := cu .ComputeCryptoHash (hashBytes )
46
46
47
47
authorizeItem := & cb.SignedConfigurationItem {
48
- ConfigurationItem : utils . MarshalOrPanic (& cb.ConfigurationItem {
48
+ ConfigurationItem : MarshalOrPanic (& cb.ConfigurationItem {
49
49
Header : & cb.ChainHeader {
50
50
ChainID : newChainID ,
51
51
Type : int32 (cb .HeaderType_CONFIGURATION_ITEM ),
52
52
},
53
53
Type : cb .ConfigurationItem_Orderer ,
54
54
Key : CreationPolicyKey ,
55
- Value : utils . MarshalOrPanic (& CreationPolicy {
55
+ Value : MarshalOrPanic (& ab. CreationPolicy {
56
56
Policy : creationPolicy ,
57
57
Digest : digest ,
58
58
}),
@@ -73,14 +73,14 @@ func ChainCreationConfigurationTransaction(creationPolicy, newChainID string, te
73
73
configurationEnvelope := ChainCreationConfiguration (creationPolicy , newChainID , template )
74
74
75
75
newGenesisTx := & cb.Envelope {
76
- Payload : utils . MarshalOrPanic (& cb.Payload {
76
+ Payload : MarshalOrPanic (& cb.Payload {
77
77
Header : & cb.Header {
78
78
ChainHeader : & cb.ChainHeader {
79
79
Type : int32 (cb .HeaderType_CONFIGURATION_TRANSACTION ),
80
80
ChainID : newChainID ,
81
81
},
82
82
},
83
- Data : utils . MarshalOrPanic (configurationEnvelope ),
83
+ Data : MarshalOrPanic (configurationEnvelope ),
84
84
}),
85
85
}
86
86
0 commit comments