github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/common/genesis/genesis_test.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package genesis
     8  
     9  import (
    10  	"testing"
    11  
    12  	"github.com/hyperledger/fabric/protoutil"
    13  	"github.com/stretchr/testify/assert"
    14  )
    15  
    16  func TestBasicSanity(t *testing.T) {
    17  	impl := NewFactoryImpl(protoutil.NewConfigGroup())
    18  	impl.Block("testchannelid")
    19  }
    20  
    21  func TestForTransactionID(t *testing.T) {
    22  	impl := NewFactoryImpl(protoutil.NewConfigGroup())
    23  	block := impl.Block("testchannelid")
    24  	configEnv, _ := protoutil.ExtractEnvelope(block, 0)
    25  	configEnvPayload, _ := protoutil.UnmarshalPayload(configEnv.Payload)
    26  	configEnvPayloadChannelHeader, _ := protoutil.UnmarshalChannelHeader(configEnvPayload.GetHeader().ChannelHeader)
    27  	assert.NotEmpty(t, configEnvPayloadChannelHeader.TxId, "tx_id of configuration transaction should not be empty")
    28  }