code: func ConfigEnvelopeFromBlock(block *common.Block) (*common.Envelope, error) {
  	if block == nil {
  		return nil, errors.New("nil block")
  	}
  
  	envelope, err := utils.ExtractEnvelope(block, 0)
  	if err != nil {
  		return nil, errors.Wrapf(err, "failed to extract envelope from the block")
  	}
  
  	channelHeader, err := utils.ChannelHeader(envelope)
  	if err != nil {
  		return nil, errors.Wrap(err, "cannot extract channel header")
  	}
  
  	switch channelHeader.Type {
  	case int32(common.HeaderType_ORDERER_TRANSACTION):
  		payload, err := utils.UnmarshalPayload(envelope.Payload)
  		if err != nil {
  			return nil, errors.Wrap(err, "failed to unmarshal envelope to extract config payload for orderer transaction")
  		}
  		configEnvelop, err := utils.UnmarshalEnvelope(payload.Data)
  		if err != nil {
  			return nil, errors.Wrap(err, "failed to unmarshal config envelope for orderer type transaction")
  		}
  
  		return configEnvelop, nil
  	case int32(common.HeaderType_CONFIG):
  		return envelope, nil
  	default:
  		return nil, errors.Errorf("unexpected header type: %v", channelHeader.Type)
  	}
  }
docs: // ConfigEnvelopeFromBlock extracts configuration envelope from the block based on the
  // config type, i.e. HeaderType_ORDERER_TRANSACTION or HeaderType_CONFIG