Ejemplo n.º 1
0
func (s *search) extendSearch(cur *pathNode) {
	// find connected assets
	var connected []xdr.Asset
	q := db.ConnectedAssetsQuery{s.Finder.SqlQuery, cur.Asset}
	s.Err = db.Select(s.Finder.Ctx, q, &connected)
	if s.Err != nil {
		return
	}

	for _, a := range connected {
		newPath := &pathNode{
			Asset: a,
			Tail:  cur,
			DB:    s.Finder.SqlQuery,
		}

		var hasEnough bool
		hasEnough, s.Err = s.hasEnoughDepth(newPath)
		if s.Err != nil {
			return
		}

		if !hasEnough {
			continue
		}

		s.queue = append(s.queue, newPath)
	}
}
Ejemplo n.º 2
0
func (action *PathIndexAction) LoadSourceAssets() {
	q := db.AssetsForAddressQuery{
		SqlQuery: action.App.CoreQuery(),
		Address:  action.GetAddress("source_account"),
	}
	action.Err = db.Select(action.Ctx, q, &action.Query.SourceAssets)
}
Ejemplo n.º 3
0
// LoadRecords populates action.Records
func (action *OperationIndexAction) LoadRecords() {
	action.LoadQuery()
	if action.Err != nil {
		return
	}

	action.Err = db.Select(action.Ctx, action.Query, &action.Records)
}
Ejemplo n.º 4
0
// LoadRecords populates action.Records
func (action *OffersByAccountAction) LoadRecords() {
	action.LoadQuery()
	if action.Err != nil {
		return
	}

	action.Err = db.Select(action.Ctx, action.Query, &action.Records)
}
Ejemplo n.º 5
0
// LoadRecords populates action.Records
func (action *EffectIndexAction) LoadRecords() {
	action.Err = db.Select(action.Ctx, action.Query, &action.Records)
}
Ejemplo n.º 6
0
// LoadRecords populates action.Records
func (action *OffersByAccountAction) LoadRecords() {
	action.Err = db.Select(action.Ctx, action.Query, &action.Records)
}
Ejemplo n.º 7
0
// LoadRecord populates action.Record
func (action *OrderBookShowAction) LoadRecord() {
	action.Err = db.Select(action.Ctx, action.Query, &action.Record)
}