func NewWorker(logger log.Logger, db *reform.DB, ethBack eth.Backend,
	gasConc *GasConf, pscAddr common.Address, payAddr string,
	pwdGetter data.PWDGetter, countryConf *country.Config,
	decryptKeyFunc data.ToPrivateKeyFunc, eptConf *ept.Config,
	torHostname string, somcClientBuilder somc.ClientBuilderInterface) (*Worker, error) {

	l := logger.Add("type", "proc/worker.Worker")

	abi, err := abi.JSON(
		strings.NewReader(contract.PrivatixServiceContractABI))
	if err != nil {
		return nil, err
	}

	eptService, err := ept.New(db, logger, payAddr, eptConf.Timeout)
	if err != nil {
		return nil, err
	}

	return &Worker{
		abi:               abi,
		logger:            l,
		db:                db,
		decryptKeyFunc:    decryptKeyFunc,
		gasConf:           gasConc,
		ept:               eptService,
		ethBack:           ethBack,
		pscAddr:           pscAddr,
		pwdGetter:         pwdGetter,
		countryConfig:     countryConf,
		torHostName:       data.FromBytes([]byte(torHostname)),
		somcClientBuilder: somcClientBuilder,
	}, nil
}
func NewWorker(logger log.Logger, db *reform.DB, ethBack eth.Backend,
	gasConc *GasConf, pscAddr common.Address, payAddr string,
	pwdGetter data.PWDGetter, countryConf *country.Config,
	decryptKeyFunc data.ToPrivateKeyFunc, eptConf *ept.Config,
	torHostname string, somcClientBuilder somc.ClientBuilderInterface) (*Worker, error) {

	l := logger.Add("type", "proc/worker.Worker")

	abi, err := abi.JSON(
		strings.NewReader(contract.PrivatixServiceContractABI))
	if err != nil {
		return nil, err
	}

	eptService, err := ept.New(db, logger, payAddr, eptConf.Timeout)
	if err != nil {
		return nil, err
	}

	return &Worker{
		abi:               abi,
		logger:            l,
		db:                db,
		decryptKeyFunc:    decryptKeyFunc,
		gasConf:           gasConc,
		ept:               eptService,
		ethBack:           ethBack,
		pscAddr:           pscAddr,
		pwdGetter:         pwdGetter,
		countryConfig:     countryConf,
		torHostName:       data.FromBytes([]byte(torHostname)),
		somcClientBuilder: somcClientBuilder,
	}, nil
}
func NewWorker ( logger log . Logger , db * reform . DB , ethBack eth . Backend , gasConc * GasConf , pscAddr common . Address , payAddr string , pwdGetter data . PWDGetter , countryConf * country . Config , decryptKeyFunc data . ToPrivateKeyFunc , eptConf * ept . Config , torHostname string , somcClientBuilder somc . ClientBuilderInterface ) ( * Worker , error ) { l := logger . Add ( " " , " " ) abi , err := abi . JSON ( strings . NewReader ( contract . PrivatixServiceContractABI ) ) if err != nil { return nil , err } eptService , err := ept . New ( db , logger , payAddr , eptConf . Timeout ) if err != nil { return nil , err } return & Worker { abi : abi , logger : l , db : db , decryptKeyFunc : decryptKeyFunc , gasConf : gasConc , ept : eptService , ethBack : ethBack , pscAddr : pscAddr , pwdGetter : pwdGetter , countryConfig : countryConf , torHostName : data . FromBytes ( [ ] byte ( torHostname ) ) , somcClientBuilder : somcClientBuilder , } , nil }
// NewWorker returns new instance of worker.
NewWorker returns new instance of worker .