diff --git a/integration/lifecycle/lifecycle_test.go b/integration/lifecycle/lifecycle_test.go index 8427208723c..2bca9d47c34 100644 --- a/integration/lifecycle/lifecycle_test.go +++ b/integration/lifecycle/lifecycle_test.go @@ -8,6 +8,7 @@ package lifecycle import ( "bytes" + "encoding/json" "os" "path/filepath" "syscall" @@ -297,6 +298,9 @@ var _ = Describe("Lifecycle", func() { currentConfig := nwo.GetConfig(network, testPeers[0], orderer, "testchannel") updatedConfig := proto.Clone(currentConfig).(*common.Config) + jsonObj, err := json.MarshalIndent(updatedConfig, "", " ") + _ = os.WriteFile("updatedConfig.json", jsonObj, 0644) + // get the configtx info for org3 sess, err = network.ConfigTxGen(commands.PrintOrg{ ConfigPath: network.RootDir, @@ -307,6 +311,10 @@ var _ = Describe("Lifecycle", func() { org3Group := &ordererext.DynamicOrdererOrgGroup{ConfigGroup: &common.ConfigGroup{}} err = protolator.DeepUnmarshalJSON(bytes.NewBuffer(sess.Out.Contents()), org3Group) Expect(err).NotTo(HaveOccurred()) + //delete(org3Group.Values, "Endpoints") + + jsonObj, err = json.MarshalIndent(org3Group, "", " ") + _ = os.WriteFile("org3Group.json", jsonObj, 0644) // update the channel config to include org3 updatedConfig.ChannelGroup.Groups["Application"].Groups["Org3"] = org3Group.ConfigGroup diff --git a/orderer/common/cluster/util_test.go b/orderer/common/cluster/util_test.go index 48a34865cf1..c44adb91f17 100644 --- a/orderer/common/cluster/util_test.go +++ b/orderer/common/cluster/util_test.go @@ -9,6 +9,7 @@ package cluster_test import ( "bytes" "context" + "crypto/sha256" "crypto/x509" "encoding/pem" "errors" @@ -789,8 +790,18 @@ func TestBlockVerifierBuilderNoConfigBlock(t *testing.T) { func TestBlockVerifierFunc(t *testing.T) { block := sampleConfigBlock(t) - require.NotNil(t, block) - bvfunc := cluster.BlockVerifierBuilder(&mocks.BCCSP{}) + //require.NotNil(t, block) + + //cp, err := sw.NewDefaultSecurityLevelWithKeystore(sw.NewDummyKeyStore()) + //require.NoError(t, err) + //hash, err := cp.GetHash(&bccsp.SHA256Opts{}) + //require.NoError(t, err) + //require.NotNil(t, hash) + + bccsp := &mocks.BCCSP{} + bccsp.GetHashReturns(sha256.New(), nil) + + bvfunc := cluster.BlockVerifierBuilder(bccsp) verifier := bvfunc(block) @@ -895,7 +906,7 @@ func sampleConfigBlock(t *testing.T) *common.Block { Id: 1, Host: "host1", Port: 8001, - MspId: "msp1", + MspId: "SampleOrg", Identity: []byte("identity1"), }, },