Commit 5636636c authored by David Enyeart's avatar David Enyeart Committed by Gerrit Code Review
Browse files

Merge "FAB-10304 Allow idemix proto translation"

parents 420f2c8b 2e57965a
/*
Copyright IBM Corp. 2017 All Rights Reserved.
Copyright IBM Corp. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
*/
package protolator_test
......@@ -25,6 +15,7 @@ import (
genesisconfig "github.com/hyperledger/fabric/common/tools/configtxgen/localconfig"
. "github.com/hyperledger/fabric/common/tools/protolator"
cb "github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/msp"
"github.com/hyperledger/fabric/protos/utils"
"github.com/golang/protobuf/proto"
......@@ -67,6 +58,15 @@ func TestConfigUpdate(t *testing.T) {
})
}
func TestIdemix(t *testing.T) {
bidirectionalMarshal(t, &msp.MSPConfig{
Type: 1,
Config: utils.MarshalOrPanic(&msp.IdemixMSPConfig{
Name: "fooo",
}),
})
}
func TestGenesisBlock(t *testing.T) {
p := encoder.New(configtxgentest.Load(genesisconfig.SampleSingleMSPSoloProfile))
gb := p.GenesisBlockForChannel("foo")
......
......@@ -33,6 +33,8 @@ func (mc *MSPConfig) VariablyOpaqueFieldProto(name string) (proto.Message, error
switch mc.Type {
case 0:
return &FabricMSPConfig{}, nil
case 1:
return &IdemixMSPConfig{}, nil
default:
return nil, fmt.Errorf("unable to decode MSP type: %v", mc.Type)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment