SDK Core Audit - simapp updates (#9315)
* Make package imports consistent * Update comment * Update FundAccount/FundModuleAccount * Fix bench test Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
This commit is contained in:
co-authored by
atheeshp
parent
321aed823c
commit
9d0504808a
@@ -32,7 +32,7 @@ func (s *paginationTestSuite) TestFilteredPaginations() {
|
||||
addr1 := sdk.AccAddress([]byte("addr1"))
|
||||
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
|
||||
app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
s.Require().NoError(simapp.FundAccount(app, ctx, addr1, balances))
|
||||
s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances))
|
||||
store := ctx.KVStore(app.GetKey(types.StoreKey))
|
||||
|
||||
// verify pagination with limit > total values
|
||||
@@ -107,7 +107,7 @@ func (s *paginationTestSuite) TestReverseFilteredPaginations() {
|
||||
addr1 := sdk.AccAddress([]byte("addr1"))
|
||||
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
|
||||
app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
s.Require().NoError(simapp.FundAccount(app, ctx, addr1, balances))
|
||||
s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances))
|
||||
store := ctx.KVStore(app.GetKey(types.StoreKey))
|
||||
|
||||
// verify pagination with limit > total values
|
||||
@@ -188,7 +188,7 @@ func ExampleFilteredPaginate() {
|
||||
addr1 := sdk.AccAddress([]byte("addr1"))
|
||||
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
|
||||
app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
err := simapp.FundAccount(app, ctx, addr1, balances)
|
||||
err := simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)
|
||||
if err != nil { // should return no error
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func (s *paginationTestSuite) TestPagination() {
|
||||
addr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address())
|
||||
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
|
||||
app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
s.Require().NoError(simapp.FundAccount(app, ctx, addr1, balances))
|
||||
s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances))
|
||||
|
||||
s.T().Log("verify empty page request results a max of defaultLimit records and counts total records")
|
||||
pageReq := &query.PageRequest{}
|
||||
@@ -185,7 +185,7 @@ func (s *paginationTestSuite) TestReversePagination() {
|
||||
addr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address())
|
||||
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
|
||||
app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
s.Require().NoError(simapp.FundAccount(app, ctx, addr1, balances))
|
||||
s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances))
|
||||
|
||||
s.T().Log("verify paginate with custom limit and countTotal, Reverse false")
|
||||
pageReq := &query.PageRequest{Limit: 2, CountTotal: true, Reverse: true, Key: nil}
|
||||
@@ -306,7 +306,7 @@ func ExamplePaginate() {
|
||||
addr1 := sdk.AccAddress([]byte("addr1"))
|
||||
acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1)
|
||||
app.AccountKeeper.SetAccount(ctx, acc1)
|
||||
err := simapp.FundAccount(app, ctx, addr1, balances)
|
||||
err := simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)
|
||||
if err != nil { // should return no error
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user