proc/worker/agent.go
func (w *Worker) AgentAfterOfferingMsgBCPublish(job *data.Job) error {
	logger := w.logger.Add("method", "AgentAfterOfferingMsgBCPublish",
		"job", job)
	offering, err := w.relatedOffering(logger, job,
		data.JobAgentAfterOfferingMsgBCPublish)
	if err != nil {
		return err
	}

	ethLog, err := w.ethLog(logger, job)
	if err != nil {
		return err
	}

	logger = logger.Add("ethLog", ethLog)

	offering.Status = data.OfferRegistered
	offering.BlockNumberUpdated = ethLog.Block
	if err = w.db.Update(offering); err != nil {
		logger.Error(err.Error())
		return ErrInternal
	}

	agent, err := w.account(logger, offering.Agent)
	if err != nil {
		return err
	}

	return w.addJob(logger, nil,
		data.JobAccountUpdateBalances, data.JobAccount, agent.ID)
}
func (w *Worker) AgentAfterOfferingMsgBCPublish(job *data.Job) error {
	logger := w.logger.Add("method", "AgentAfterOfferingMsgBCPublish",
		"job", job)
	offering, err := w.relatedOffering(logger, job,
		data.JobAgentAfterOfferingMsgBCPublish)
	if err != nil {
		return err
	}

	ethLog, err := w.ethLog(logger, job)
	if err != nil {
		return err
	}

	logger = logger.Add("ethLog", ethLog)

	offering.Status = data.OfferRegistered
	offering.BlockNumberUpdated = ethLog.Block
	if err = w.db.Update(offering); err != nil {
		logger.Error(err.Error())
		return ErrInternal
	}

	agent, err := w.account(logger, offering.Agent)
	if err != nil {
		return err
	}

	return w.addJob(logger, nil,
		data.JobAccountUpdateBalances, data.JobAccount, agent.ID)
}
func ( w * Worker ) AgentAfterOfferingMsgBCPublish ( job * data . Job ) error { logger := w . logger . Add ( " " , " " , " " , job ) offering , err := w . relatedOffering ( logger , job , data . JobAgentAfterOfferingMsgBCPublish ) if err != nil { return err } ethLog , err := w . ethLog ( logger , job ) if err != nil { return err } logger = logger . Add ( " " , ethLog ) offering . Status = data . OfferRegistered offering . BlockNumberUpdated = ethLog . Block if err = w . db . Update ( offering ) ; err != nil { logger . Error ( err . Error ( ) ) return ErrInternal } agent , err := w . account ( logger , offering . Agent ) if err != nil { return err } return w . addJob ( logger , nil , data . JobAccountUpdateBalances , data . JobAccount , agent . ID ) }
// AgentAfterOfferingMsgBCPublish updates offering status and creates
// somc publish job.
AgentAfterOfferingMsgBCPublish updates offering status and creates somc publish job .