Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms committed Aug 5, 2024
1 parent efce41b commit 41ae183
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions services/horizon/internal/actions/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/stellar/go/protocols/horizon"
"github.com/stellar/go/services/horizon/internal/db2/history"
"github.com/stellar/go/services/horizon/internal/ledger"
"github.com/stellar/go/services/horizon/internal/test"
supportProblem "github.com/stellar/go/support/render/problem"
)
Expand All @@ -16,7 +17,10 @@ func TestGetTransactionsHandler(t *testing.T) {
defer tt.Finish()

q := &history.Q{tt.HorizonSession()}
handler := GetTransactionsHandler{}
handler := GetTransactionsHandler{
LedgerState: &ledger.State{},
}
handler.LedgerState.SetStatus(tt.Scenario("base"))

// filter by account
records, err := handler.GetResourcePage(
Expand Down Expand Up @@ -155,7 +159,14 @@ func TestFeeBumpTransactionPage(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &history.Q{tt.HorizonSession()}
fixture := history.FeeBumpScenario(tt, q, true)
handler := GetTransactionsHandler{}
handler := GetTransactionsHandler{
LedgerState: &ledger.State{},
}
handler.LedgerState.SetHorizonStatus(ledger.HorizonStatus{
HistoryLatest: fixture.Ledger.Sequence,
HistoryElder: fixture.Ledger.Sequence,
ExpHistoryLatest: uint32(fixture.Ledger.Sequence),
})

records, err := handler.GetResourcePage(
httptest.NewRecorder(),
Expand Down

0 comments on commit 41ae183

Please sign in to comment.