func (s *Service) UpdateBalancesWeightsAndSupplies(
	block uint64,
	pool config.Pool,
	contract *sigmacore.Sigmacore,
) (
	balances map[string]interface{},
	denormWeights map[string]interface{},
	totalSupplies map[string]interface{},
	err error,
) {
	tokens, err := utils.PoolTokensFor(contract, s.ew.BC())
	if err != nil {
		s.logger.Error("failed to get pool tokens", zap.Error(err))
		return
	}
	balances, denormWeights, totalSupplies, err = s.GetBalancesWeightsAndSupplies(contract, block, pool.ContractAddress, tokens)
	if err != nil {
		s.logger.Error("GetBalancesAndWeight call failed", zap.Error(err), zap.String("pool", pool.Name))
		return
	}
	err = s.db.RecordInfo(pool.Name, block, balances, denormWeights, totalSupplies)
	return
}
// UpdateBalancesWeightsAndSupplies is used to update all balances, weights, and supplies for a given pool
// Note: If using from many different threads, caller will want to make sure to call the service named locks
UpdateBalancesWeightsAndSupplies is used to update all balances, weights, and supplies for a given pool
Note: If using from many different threads, caller will want to make sure to call the service named locks
// UpdateBalancesWeightsAndSupplies is used to update all balances weights and supplies for a given pool // Note : If using from many different threads caller will want to make sure to call the service named locks
func (s *Service) UpdateBalancesWeightsAndSupplies(
	block uint64,
	pool config.Pool,
	contract *sigmacore.Sigmacore,
) (
	balances map[string]interface{},
	denormWeights map[string]interface{},
	totalSupplies map[string]interface{},
	err error,
) {
	tokens, err := utils.PoolTokensFor(contract, s.ew.BC())
	if err != nil {
		s.logger.Error("failed to get pool tokens", zap.Error(err))
		return
	}
	balances, denormWeights, totalSupplies, err = s.GetBalancesWeightsAndSupplies(contract, block, pool.ContractAddress, tokens)
	if err != nil {
		s.logger.Error("GetBalancesAndWeight call failed", zap.Error(err), zap.String("pool", pool.Name))
		return
	}
	err = s.db.RecordInfo(pool.Name, block, balances, denormWeights, totalSupplies)
	return
}
func ( s * Service ) UpdateBalancesWeightsAndSupplies ( block uint64 , pool config . Pool , contract * sigmacore . Sigmacore , ) ( balances map [ string ] interface { } , denormWeights map [ string ] interface { } , totalSupplies map [ string ] interface { } , err error , ) { tokens , err := utils . PoolTokensFor ( contract , s . ew . BC ( ) ) if err != nil { s . logger . Error ( " " , zap . Error ( err ) ) return } balances , denormWeights , totalSupplies , err = s . GetBalancesWeightsAndSupplies ( contract , block , pool . ContractAddress , tokens ) if err != nil { s . logger . Error ( " " , zap . Error ( err ) , zap . String ( " " , pool . Name ) ) return } err = s . db . RecordInfo ( pool . Name , block , balances , denormWeights , totalSupplies ) return }
UpdateBalancesWeightsAndSupplies is used to update all balances, weights, and supplies for a given pool
Note: If using from many different threads, caller will want to make sure to call the service named locks
UpdateBalancesWeightsAndSupplies is used to update all balances weights and supplies for a given pool Note : If using from many different threads caller will want to make sure to call the service named locks