mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 15:24:26 -08:00
basic linear vesting payouts (manual claim)
This commit is contained in:
29
x/colinearcore/simulation/claim_funds.go
Normal file
29
x/colinearcore/simulation/claim_funds.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"colinear/x/colinearcore/keeper"
|
||||
"colinear/x/colinearcore/types"
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
)
|
||||
|
||||
func SimulateMsgClaimFunds(
|
||||
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.MsgClaimFunds{
|
||||
Creator: simAccount.Address.String(),
|
||||
}
|
||||
|
||||
// TODO: Handling the ClaimFunds simulation
|
||||
|
||||
return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ClaimFunds simulation not implemented"), nil, nil
|
||||
}
|
||||
}
|
||||
18
x/colinearcore/simulation/simap.go.bak
Normal file
18
x/colinearcore/simulation/simap.go.bak
Normal file
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
}
|
||||
|
||||
// New version of Ignite auto-generated helpers.go, which seems to be
|
||||
// a duplicate of this. Back it up for now.
|
||||
Reference in New Issue
Block a user