Skip to content

Commit

Permalink
fix generate address by order
Browse files Browse the repository at this point in the history
  • Loading branch information
duonghb53 committed Nov 4, 2024
1 parent 2f33b29 commit d780c04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom/gov/keeper/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/classic-terra/core/v3/custom/gov/types/v2lunc1"
core "github.com/classic-terra/core/v3/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/testutil/testdata"
Expand All @@ -27,13 +28,16 @@ func TestAddDeposits(t *testing.T) {
bankKeeper := input.BankKeeper
govKeeper := input.GovKeeper
oracleKeeper := input.OracleKeeper
stakingKeeper := input.StakingKeeper
ctx := input.Ctx

oracleKeeper.SetLunaExchangeRate(ctx, core.MicroUSDDenom, sdk.OneDec())
lunaCoin := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10_000_000_000)))

_, _, addr1 := testdata.KeyTestPubAddr()
_, _, addr2 := testdata.KeyTestPubAddr()
TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10_000_000))
addr1 := TestAddrs[0]
addr2 := TestAddrs[1]

err := FundAccount(input, addr1, lunaCoin)
require.NoError(t, err)
err1 := FundAccount(input, addr2, lunaCoin)
Expand Down
3 changes: 3 additions & 0 deletions custom/gov/keeper/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand Down Expand Up @@ -164,6 +165,7 @@ func CreateTestInput(t *testing.T) TestInput {
stakingtypes.NotBondedPoolName: true,
stakingtypes.BondedPoolName: true,
distrtypes.ModuleName: true,
minttypes.ModuleName: true,
}

maccPerms := map[string][]string{
Expand All @@ -175,6 +177,7 @@ func CreateTestInput(t *testing.T) TestInput {
oracletypes.ModuleName: nil,
markettypes.ModuleName: {authtypes.Burner, authtypes.Minter},
govtypes.ModuleName: {authtypes.Burner, authtypes.Minter},
minttypes.ModuleName: {authtypes.Minter},
}

paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, keyParams, tKeyParams)
Expand Down

0 comments on commit d780c04

Please sign in to comment.