mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-07 02:04:25 -08:00
cosmostest -> colinear in dir structure
This commit is contained in:
30
x/colinear-core/simulation/new_auction.go
Normal file
30
x/colinear-core/simulation/new_auction.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"colinear/x/colinear-core/keeper"
|
||||
"colinear/x/colinear-core/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
)
|
||||
|
||||
func SimulateMsgNewAuction(
|
||||
ak types.AccountKeeper,
|
||||
bk types.BankKeeper,
|
||||
k keeper.Keeper,
|
||||
) simtypes.Operation {
|
||||
return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
simAccount, _ := simtypes.RandomAcc(r, accs)
|
||||
msg := &types.MsgNewAuction{
|
||||
Creator: simAccount.Address.String(),
|
||||
}
|
||||
|
||||
// TODO: Handling the NewAuction simulation
|
||||
|
||||
return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "NewAuction simulation not implemented"), nil, nil
|
||||
}
|
||||
}
|
||||
30
x/colinear-core/simulation/new_bid.go
Normal file
30
x/colinear-core/simulation/new_bid.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"colinear/x/colinear-core/keeper"
|
||||
"colinear/x/colinear-core/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
)
|
||||
|
||||
func SimulateMsgNewBid(
|
||||
ak types.AccountKeeper,
|
||||
bk types.BankKeeper,
|
||||
k keeper.Keeper,
|
||||
) simtypes.Operation {
|
||||
return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
simAccount, _ := simtypes.RandomAcc(r, accs)
|
||||
msg := &types.MsgNewBid{
|
||||
Creator: simAccount.Address.String(),
|
||||
}
|
||||
|
||||
// TODO: Handling the NewBid simulation
|
||||
|
||||
return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "NewBid simulation not implemented"), nil, nil
|
||||
}
|
||||
}
|
||||
15
x/colinear-core/simulation/simap.go
Normal file
15
x/colinear-core/simulation/simap.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
)
|
||||
|
||||
// FindAccount find a specific address from an account list
|
||||
func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) {
|
||||
creator, err := sdk.AccAddressFromBech32(address)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return simtypes.FindAccount(accs, creator)
|
||||
}
|
||||
Reference in New Issue
Block a user