proc/worker/misc.go
func (w *Worker) keyFromChannelData(logger log.Logger,
	channel string) (data.Base64String, error) {
	ch, err := w.channel(logger, channel)
	if err != nil {
		return "", err
	}

	offering, err := w.offering(logger, ch.Offering)
	if err != nil {
		return "", err
	}

	key, err := data.ChannelKey(ch.Client, ch.Agent,
		ch.Block, offering.Hash)
	// internal
	if err != nil {
		logger.Add("channel", ch, "offering", offering).Error(err.Error())
		return "", ErrInternal
	}
	return data.FromBytes(key), nil
}
func (w *Worker) keyFromChannelData(logger log.Logger,
	channel string) (data.Base64String, error) {
	ch, err := w.channel(logger, channel)
	if err != nil {
		return "", err
	}

	offering, err := w.offering(logger, ch.Offering)
	if err != nil {
		return "", err
	}

	key, err := data.ChannelKey(ch.Client, ch.Agent,
		ch.Block, offering.Hash)
	// internal
	if err != nil {
		logger.Add("channel", ch, "offering", offering).Error(err.Error())
		return "", ErrInternal
	}
	return data.FromBytes(key), nil
}
func ( w * Worker ) keyFromChannelData ( logger log . Logger , channel string ) ( data . Base64String , error ) { ch , err := w . channel ( logger , channel ) if err != nil { return " " , err } offering , err := w . offering ( logger , ch . Offering ) if err != nil { return " " , err } key , err := data . ChannelKey ( ch . Client , ch . Agent , ch . Block , offering . Hash ) // internal if err != nil { logger . Add ( " " , ch , " " , offering ) . Error ( err . Error ( ) ) return " " , ErrInternal } return data . FromBytes ( key ) , nil }
// keyFromChannelData returns the unique channel identifier
// used in a Privatix Service Contract.
keyFromChannelData returns the unique channel identifier used in a Privatix Service Contract .