Example #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)
	}
}
Example #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)
}
Example #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)
}
Example #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)
}
Example #5
0
// LoadRecords populates action.Records
func (action *EffectIndexAction) LoadRecords() {
	action.Err = db.Select(action.Ctx, action.Query, &action.Records)
}
Example #6
0
// LoadRecords populates action.Records
func (action *OffersByAccountAction) LoadRecords() {
	action.Err = db.Select(action.Ctx, action.Query, &action.Records)
}
Example #7
0
// LoadRecord populates action.Record
func (action *OrderBookShowAction) LoadRecord() {
	action.Err = db.Select(action.Ctx, action.Query, &action.Record)
}