Skip to content

Commit

Permalink
stellar#4433: added interfaces for transactxion and account data access
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jul 10, 2022
1 parent 09ebf0a commit fc233f8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion exp/lighthorizon/services/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ import (
)

type LightHorizon struct {
Archive archive.Archive
AccountService,
TransactionService,
Archive archive.Archive
Passphrase string
IndexStore index.Store
}

type AccountService interface {
GetOperationsByAccount(ctx context.Context, cursor int64, limit int64, accountId string) ([]common.Operation, error)
GetOperations(ctx context.Context, cursor int64, limit int64) ([]common.Operation, error)
}

type TransactionService interface {
GetTransactionsByAccount(ctx context.Context, cursor int64, limit int64, accountId string) ([]common.Transaction, error)
GetTransactions(ctx context.Context, cursor int64, limit int64) ([]common.Transaction, error)
}

func (lh *LightHorizon) GetOperationsByAccount(ctx context.Context, cursor int64, limit int64, accountId string) ([]common.Operation, error) {
ops := []common.Operation{}
// Skip the cursor ahead to the next active checkpoint for this account
Expand Down

0 comments on commit fc233f8

Please sign in to comment.