Skip to content
Closed
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
1 change: 0 additions & 1 deletion x/gov/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func setupGovKeeper(t *testing.T) (
stakingKeeper.EXPECT().IterateBondedValidatorsByPower(gomock.Any(), gomock.Any()).AnyTimes()
stakingKeeper.EXPECT().IterateDelegations(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000), nil).AnyTimes()
distributionKeeper.EXPECT().FundCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()

// Gov keeper initializations

Expand Down
6 changes: 2 additions & 4 deletions x/gov/keeper/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ func TestDeposits(t *testing.T) {

for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
govKeeper, authKeeper, bankKeeper, stakingKeeper, distKeeper, _, ctx := setupGovKeeper(t)
trackMockBalances(bankKeeper, distKeeper)
govKeeper, authKeeper, bankKeeper, stakingKeeper, _, _, ctx := setupGovKeeper(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

LGTM: removed dist keeper binding in TestDeposits

Ignoring the 5th/6th returns from setupGovKeeper aligns with deduping FundCommunityPool expectations and removing redundant balance tracking.

Run to ensure no leftover redundant tracking calls remain:


🏁 Script executed:

#!/bin/bash
# Find redundant balance tracking helpers still present in gov tests
rg -nP 'trackMockBalances\s*\(' x/gov -g '**/*_test.go'

Length of output: 292


Remove leftover redundant balance-tracking helper calls

  • x/gov/keeper/common_test.go: delete the trackMockBalances(bankKeeper, distributionKeeper) invocation at line 90 and the trackMockBalances helper definition at line 122.
🤖 Prompt for AI Agents
In x/gov/keeper/deposit_test.go around line 41, and specifically in
x/gov/keeper/common_test.go at lines 90 and 122, there are leftover redundant
balance-tracking helper usages: remove the call to trackMockBalances(bankKeeper,
distributionKeeper) at line 90 and delete the entire trackMockBalances helper
definition at line 122; after removal, run tests and remove any now-unused
imports related to that helper (or references) to keep the file clean.


// With expedited proposals the minimum deposit is higher, so we must
// initialize and deposit an amount depositMultiplier times larger
Expand Down Expand Up @@ -207,8 +206,7 @@ func TestDepositAmount(t *testing.T) {

for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
govKeeper, authKeeper, bankKeeper, stakingKeeper, distrKeeper, _, ctx := setupGovKeeper(t)
trackMockBalances(bankKeeper, distrKeeper)
govKeeper, authKeeper, bankKeeper, stakingKeeper, _, _, ctx := setupGovKeeper(t)

testAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(1000000000000000))
authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes()
Expand Down