Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
urvisavla committed Nov 7, 2023
1 parent 4224434 commit 2166f8e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestGetClaimableBalances(t *testing.T) {

tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
defer func() {
_ = q.SessionInterface.Rollback()
_ = q.Rollback()
}()

entriesMeta := []struct {
Expand Down
20 changes: 10 additions & 10 deletions services/horizon/internal/db2/history/claimable_balances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ func TestRemoveClaimableBalance(t *testing.T) {
defer tt.Finish()
test.ResetHorizonDB(t, tt.HorizonDB)
q := &Q{tt.HorizonSession()}
tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
defer func() {
_ = q.SessionInterface.Rollback()
_ = q.Rollback()
}()

accountID := "GC3C4AKRBQLHOJ45U4XG35ESVWRDECWO5XLDGYADO6DPR3L7KIDVUMML"
Expand Down Expand Up @@ -69,9 +69,9 @@ func TestRemoveClaimableBalanceClaimants(t *testing.T) {
defer tt.Finish()
test.ResetHorizonDB(t, tt.HorizonDB)
q := &Q{tt.HorizonSession()}
tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
defer func() {
_ = q.SessionInterface.Rollback()
_ = q.Rollback()
}()

accountID := "GC3C4AKRBQLHOJ45U4XG35ESVWRDECWO5XLDGYADO6DPR3L7KIDVUMML"
Expand Down Expand Up @@ -264,9 +264,9 @@ func TestFindClaimableBalancesByDestinationWithLimit(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &Q{tt.HorizonSession()}

tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
defer func() {
_ = q.SessionInterface.Rollback()
_ = q.Rollback()
}()

assetIssuer := "GA25GQLHJU3LPEJXEIAXK23AWEA5GWDUGRSHTQHDFT6HXHVMRULSQJUJ"
Expand Down Expand Up @@ -411,9 +411,9 @@ func TestFindClaimableBalance(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &Q{tt.HorizonSession()}

tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
defer func() {
_ = q.SessionInterface.Rollback()
_ = q.Rollback()
}()

accountID := "GC3C4AKRBQLHOJ45U4XG35ESVWRDECWO5XLDGYADO6DPR3L7KIDVUMML"
Expand Down Expand Up @@ -460,9 +460,9 @@ func TestGetClaimableBalancesByID(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &Q{tt.HorizonSession()}

tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))
defer func() {
_ = q.SessionInterface.Rollback()
_ = q.Rollback()
}()

accountID := "GC3C4AKRBQLHOJ45U4XG35ESVWRDECWO5XLDGYADO6DPR3L7KIDVUMML"
Expand Down
12 changes: 6 additions & 6 deletions services/horizon/internal/ingest/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ func TestStateVerifierLockBusy(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &history.Q{&db.Session{DB: tt.HorizonDB}}

tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))

checkpointLedger := uint32(63)
changeProcessor := buildChangeProcessor(q, q.SessionInterface, &ingest.StatsChangeProcessor{}, ledgerSource, checkpointLedger, "")
changeProcessor := buildChangeProcessor(q, q, &ingest.StatsChangeProcessor{}, ledgerSource, checkpointLedger, "")

gen := randxdr.NewGenerator()
var changes []xdr.LedgerEntryChange
Expand All @@ -293,7 +293,7 @@ func TestStateVerifierLockBusy(t *testing.T) {
}
tt.Assert.NoError(changeProcessor.Commit(tt.Ctx))

tt.Assert.NoError(q.SessionInterface.Commit())
tt.Assert.NoError(q.Commit())

q.UpdateLastLedgerIngest(tt.Ctx, checkpointLedger)

Expand Down Expand Up @@ -328,10 +328,10 @@ func TestStateVerifier(t *testing.T) {
test.ResetHorizonDB(t, tt.HorizonDB)
q := &history.Q{&db.Session{DB: tt.HorizonDB}}

tt.Assert.NoError(q.SessionInterface.BeginTx(tt.Ctx, &sql.TxOptions{}))
tt.Assert.NoError(q.BeginTx(tt.Ctx, &sql.TxOptions{}))

checkpointLedger := uint32(63)
changeProcessor := buildChangeProcessor(q, q.SessionInterface, &ingest.StatsChangeProcessor{}, ledgerSource, checkpointLedger, "")
changeProcessor := buildChangeProcessor(q, q, &ingest.StatsChangeProcessor{}, ledgerSource, checkpointLedger, "")
mockChangeReader := &ingest.MockChangeReader{}

gen := randxdr.NewGenerator()
Expand Down Expand Up @@ -360,7 +360,7 @@ func TestStateVerifier(t *testing.T) {
tt.Assert.NoError(changeProcessor.Commit(tt.Ctx))
tt.Assert.Equal(len(xdr.LedgerEntryTypeMap), len(coverage))

tt.Assert.NoError(q.SessionInterface.Commit())
tt.Assert.NoError(q.Commit())

q.UpdateLastLedgerIngest(tt.Ctx, checkpointLedger)

Expand Down

0 comments on commit 2166f8e

Please sign in to comment.