Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ledger: move catchpoint related methods into a storage package #4835

Merged
merged 6 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/catchpointdump/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/algorand/go-algorand/crypto/merkletrie"
"github.com/algorand/go-algorand/ledger"
"github.com/algorand/go-algorand/ledger/store"
"github.com/algorand/go-algorand/util/db"
)

Expand Down Expand Up @@ -106,7 +107,7 @@ func checkDatabase(databaseName string, outFile *os.File) error {

var stats merkletrie.Stats
err = dbAccessor.Atomic(func(ctx context.Context, tx *sql.Tx) (err error) {
committer, err := ledger.MakeMerkleCommitter(tx, ledgerTrackerStaging)
committer, err := store.MakeMerkleCommitter(tx, ledgerTrackerStaging)
if err != nil {
return err
}
Expand Down
5 changes: 4 additions & 1 deletion cmd/catchpointdump/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/algorand/go-algorand/data/transactions/logic"
"github.com/algorand/go-algorand/ledger"
"github.com/algorand/go-algorand/ledger/ledgercore"
"github.com/algorand/go-algorand/ledger/store"
"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/util/db"
Expand Down Expand Up @@ -318,6 +319,8 @@ func printAccountsDatabase(databaseName string, stagingTables bool, fileHeader l
totals.RewardsLevel)
}
return dbAccessor.Atomic(func(ctx context.Context, tx *sql.Tx) (err error) {
arw := store.NewAccountsSQLReaderWriter(tx)

fmt.Printf("\n")
printDumpingCatchpointProgressLine(0, 50, 0)

Expand Down Expand Up @@ -417,7 +420,7 @@ func printAccountsDatabase(databaseName string, stagingTables bool, fileHeader l
progress++
acctCount++
}
_, err = ledger.LoadAllFullAccounts(context.Background(), tx, balancesTable, resourcesTable, acctCb)
_, err = arw.LoadAllFullAccounts(context.Background(), balancesTable, resourcesTable, acctCb)
if err != nil {
return
}
Expand Down
Loading