Skip to content

Commit

Permalink
[FAB-4440] Fix Consortium in configtxgen code
Browse files Browse the repository at this point in the history
[FAB-4355] uses the Consortium section, as suggested by jason and david,
    this patchset update it to Consortium value.

Change-Id: I855d7a698b9c1ca32f79f9f8839a2fe7ac9912e0
Signed-off-by: Baohua Yang <baohyang@cn.ibm.com>
  • Loading branch information
yeasy committed Jun 7, 2017
1 parent c2b5f2d commit 1ddbf1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/configtx/tool/configtxgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func doOutputChannelCreateTx(conf *genesisconfig.Profile, channelID string, outp
}

if conf.Consortium == "" {
return fmt.Errorf("Cannot define a new channel with no Consortium section")
return fmt.Errorf("Cannot define a new channel with no Consortium value")
}

// XXX we ignore the non-application org names here, once the tool supports configuration updates
Expand Down
4 changes: 2 additions & 2 deletions common/configtx/tool/configtxgen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ func TestMissingOrdererSection(t *testing.T) {
assert.Error(t, doOutputBlock(config, "foo", blockDest), "Missing orderer section")
}

func TestMissingConsortiumSection(t *testing.T) {
func TestMissingConsortiumValue(t *testing.T) {
configTxDest := tmpDir + string(os.PathSeparator) + "configtx"

factory.InitFactories(nil)
config := genesisconfig.Load(genesisconfig.SampleSingleMSPChannelProfile)
config.Consortium = ""

assert.Error(t, doOutputChannelCreateTx(config, "foo", configTxDest), "Missing Consortium section in Application Profile definition")
assert.Error(t, doOutputChannelCreateTx(config, "foo", configTxDest), "Missing Consortium value in Application Profile definition")
}

func TestInspectConfigTx(t *testing.T) {
Expand Down

0 comments on commit 1ddbf1c

Please sign in to comment.