Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Shant Karakashian <55754073+algonautshant@users.noreply.github.com>
  • Loading branch information
algorandskiy and algonautshant committed Aug 3, 2023
1 parent 6b5e1b6 commit 8484a6e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions ledger/acctupdates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ func BenchmarkBalancesChanges(b *testing.B) {
conf := config.GetDefaultLocal()
maxAcctLookback := conf.MaxAcctLookback
au, _ := newAcctUpdates(b, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

// cover initialRounds genesis blocks
rewardLevel := uint64(0)
Expand Down Expand Up @@ -796,7 +796,7 @@ func testAcctUpdatesUpdatesCorrectness(t *testing.T, cfg config.Local) {
}

au, _ := newAcctUpdates(t, ml, cfg)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

// cover 10 genesis blocks
rewardLevel := uint64(0)
Expand Down Expand Up @@ -927,7 +927,7 @@ func TestBoxNamesByAppIDs(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

knownCreatables := make(map[basics.CreatableIndex]bool)
opts := auNewBlockOpts{ledgercore.AccountDeltas{}, protocol.ConsensusCurrentVersion, protoParams, knownCreatables}
Expand Down Expand Up @@ -1048,7 +1048,7 @@ func TestKVCache(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

knownCreatables := make(map[basics.CreatableIndex]bool)
opts := auNewBlockOpts{ledgercore.AccountDeltas{}, protocol.ConsensusCurrentVersion, protoParams, knownCreatables}
Expand Down Expand Up @@ -1222,7 +1222,7 @@ func BenchmarkLargeMerkleTrieRebuild(b *testing.B) {
cfg := config.GetDefaultLocal()
cfg.Archival = true
au, _ := newAcctUpdates(b, ml, cfg)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

// at this point, the database was created. We want to fill the accounts data
accountsNumber := 6000000 * b.N
Expand Down Expand Up @@ -1611,7 +1611,7 @@ func TestAcctUpdatesCachesInitialization(t *testing.T) {

conf = config.GetDefaultLocal()
au, _ = newAcctUpdates(t, ml2, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

// make sure the deltas array end up containing only the most recent 320 rounds.
require.Equal(t, int(conf.MaxAcctLookback), len(au.deltas))
Expand Down Expand Up @@ -1639,7 +1639,7 @@ func TestAcctUpdatesSplittingConsensusVersionCommits(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

// cover initialRounds genesis blocks
rewardLevel := uint64(0)
Expand Down Expand Up @@ -1744,7 +1744,7 @@ func TestAcctUpdatesSplittingConsensusVersionCommitsBoundary(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

// cover initialRounds genesis blocks
rewardLevel := uint64(0)
Expand Down Expand Up @@ -1879,7 +1879,7 @@ func TestAcctUpdatesResources(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

var addr1 basics.Address
var addr2 basics.Address
Expand Down Expand Up @@ -2086,7 +2086,7 @@ func TestAcctUpdatesLookupLatest(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()
for addr, acct := range accts {
acctData, validThrough, withoutRewards, err := au.lookupLatest(addr)
require.NoError(t, err)
Expand Down Expand Up @@ -2364,7 +2364,7 @@ func TestAcctUpdatesLookupLatestCacheRetry(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

var addr1 basics.Address
for addr := range accts[0] {
Expand Down Expand Up @@ -2493,7 +2493,7 @@ func TestAcctUpdatesLookupResources(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

var addr1 basics.Address
for addr := range accts[0] {
Expand Down Expand Up @@ -2573,7 +2573,7 @@ func TestAcctUpdatesLookupStateDelta(t *testing.T) {

conf := config.GetDefaultLocal()
au, _ := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

knownCreatables := make(map[basics.CreatableIndex]bool)

Expand Down
6 changes: 3 additions & 3 deletions ledger/voters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestVoterTrackerDeleteVotersAfterStateproofConfirmed(t *testing.T) {
// To cause all blocks to be committed, for easier processing by the voters tracker.
conf.MaxAcctLookback = 0
_, ao := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

i := uint64(1)
// adding blocks to the voterstracker (in order to pass the numOfIntervals*stateproofInterval we add 1)
Expand Down Expand Up @@ -176,7 +176,7 @@ func TestLimitVoterTracker(t *testing.T) {
conf := config.GetDefaultLocal()
// To cause all blocks to be committed, for easier processing by the voters tracker.
conf.MaxAcctLookback = 0
_, ao := newAcctUpdates(t, ml, conf)
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()
// au and ao are closed via ml.Close() -> ml.trackers.close()

i := uint64(1)
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestTopNAccountsThatHaveNoMssKeys(t *testing.T) {

conf := config.GetDefaultLocal()
_, ao := newAcctUpdates(t, ml, conf)
// au and ao are closed via ml.Close() -> ml.trackers.close()
// accountUpdates and onlineAccounts are closed via: ml.Close() -> ml.trackers.close()

i := uint64(1)
for ; i < (intervalForTest)+1; i++ {
Expand Down

0 comments on commit 8484a6e

Please sign in to comment.