update fork

This commit is contained in:
0xmuralik
2022-10-10 16:08:33 +05:30
parent 632d53e34a
commit 56d59feaa0
383 changed files with 36784 additions and 21462 deletions
+13 -5
View File
@@ -3,6 +3,7 @@ package keeper_test
import (
"context"
"fmt"
"math/rand"
"github.com/cerc-io/laconicd/app"
"github.com/cerc-io/laconicd/x/auction/types"
@@ -12,6 +13,10 @@ import (
const testCommitHash = "71D8CF34026E32A3A34C2C2D4ADF25ABC8D7943A4619761BE27F196603D91B9D"
var (
seed = int64(233)
)
func (suite *KeeperTestSuite) TestGrpcGetAllAuctions() {
client, ctx, k := suite.queryClient, suite.ctx, suite.app.AuctionKeeper
@@ -39,7 +44,9 @@ func (suite *KeeperTestSuite) TestGrpcGetAllAuctions() {
for _, test := range testCases {
suite.Run(fmt.Sprintf("Case %s", test.msg), func() {
if test.createAuctions {
account := app.CreateRandomAccounts(1)[0]
r := rand.New(rand.NewSource(seed))
accs := app.RandomAccounts(r, 1)
account := accs[0].Address
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(
sdk.Coin{Amount: sdk.NewInt(100), Denom: sdk.DefaultBondDenom},
))
@@ -327,9 +334,10 @@ func (suite *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.
accCount++
}
accounts := app.CreateRandomAccounts(accCount)
r := rand.New(rand.NewSource(seed))
accounts := app.RandomAccounts(r, 1)
for _, account := range accounts {
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account.Address, sdk.NewCoins(
sdk.Coin{Amount: sdk.NewInt(100), Denom: sdk.DefaultBondDenom},
))
if err != nil {
@@ -337,13 +345,13 @@ func (suite *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.
}
}
auction, err := k.CreateAuction(ctx, types.NewMsgCreateAuction(k.GetParams(ctx), accounts[0]))
auction, err := k.CreateAuction(ctx, types.NewMsgCreateAuction(k.GetParams(ctx), accounts[0].Address))
if err != nil {
return nil, nil, err
}
if commitBid {
bid, err := k.CommitBid(ctx, types.NewMsgCommitBid(auction.Id, testCommitHash, accounts[1]))
bid, err := k.CommitBid(ctx, types.NewMsgCommitBid(auction.Id, testCommitHash, accounts[1].Address))
if err != nil {
return nil, nil, err
}
+2 -2
View File
@@ -22,7 +22,7 @@ type KeeperTestSuite struct {
}
func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(suite.T(), false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
}
func TestParams(t *testing.T) {
testApp := app.Setup(t, false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})