basic linear vesting payouts (manual claim)

This commit is contained in:
2022-09-14 21:36:30 +00:00
parent edba09b124
commit 7f71e0be9e
15 changed files with 689 additions and 33 deletions

View 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
}
}

View 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.