cfevesting

package
v1.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAccountVestingPools added in v1.1.0

func AssertAccountVestingPools(t *testing.T, expected types.AccountVestingPools, actual types.AccountVestingPools)

func AssertAccountVestingPoolsArrays added in v1.1.0

func AssertAccountVestingPoolsArrays(t *testing.T, expected []*types.AccountVestingPools, actual []*types.AccountVestingPools)

func CreateDurationFromNumOfHours

func CreateDurationFromNumOfHours(numOfHours int64) time.Duration

func CreateTimeFromNumOfHours

func CreateTimeFromNumOfHours(numOfHours int64) time.Time

func Generate10BasedVestingTypes

func Generate10BasedVestingTypes(numberOfVestingTypes int, amountOf10BasedVestingTypes int, startId int) []*types.VestingType

func GenerateAccountVestingPoolsWith10BasedVestingPools added in v1.1.0

func GenerateAccountVestingPoolsWith10BasedVestingPools(numberOfAccounts int, numberOfVestingPoolsPerAccount int,
	accountStartId int, vestingStartId int) []*types.AccountVestingPools

func GenerateAccountVestingPoolsWithRandomVestingPools added in v1.1.0

func GenerateAccountVestingPoolsWithRandomVestingPools(numberOfAccounts int, numberOfVestingPoolsPerAccount int,
	accountStartId int, vestingStartId int) []*types.AccountVestingPools

func GenerateGenesisVestingTypes added in v1.1.0

func GenerateGenesisVestingTypes(numberOfVestingTypes int, startId int) []types.GenesisVestingType

func GenerateGenesisVestingTypesForAccounVestingPools added in v1.1.0

func GenerateGenesisVestingTypesForAccounVestingPools(accountVestingPools []*types.AccountVestingPools) []types.GenesisVestingType

func GenerateOneAccountVestingPoolsWithAddressWith10BasedVestingPools added in v1.1.0

func GenerateOneAccountVestingPoolsWithAddressWith10BasedVestingPools(numberOfVestingPoolsPerAccount int,
	accountId int, vestingStartId int) types.AccountVestingPools

func GenerateOneAccountVestingPoolsWithAddressWithRandomVestingPools added in v1.1.0

func GenerateOneAccountVestingPoolsWithAddressWithRandomVestingPools(numberOfVestingPoolsPerAccount int,
	accountId int, vestingStartId int) types.AccountVestingPools

func GenerateVestingTypes

func GenerateVestingTypes(numberOfVestingTypes int, startId int) []*types.VestingType

func GenerateVestingTypesForAccountVestingPools added in v1.1.0

func GenerateVestingTypesForAccountVestingPools(accountVestingPools []types.AccountVestingPools) []*types.VestingType

func GetExpectedWithdrawable

func GetExpectedWithdrawable(lockEnd time.Time, current time.Time, amount sdk.Int) sdk.Int

func GetExpectedWithdrawableForVesting

func GetExpectedWithdrawableForVesting(vestingPool types.VestingPool, current time.Time) sdk.Int

func GetVestingPoolByName added in v1.1.0

func GetVestingPoolByName(vps []*types.VestingPool, name string) (vp *types.VestingPool, found bool)

func ToAccountVestingPoolsPointersArray added in v1.1.0

func ToAccountVestingPoolsPointersArray(src []types.AccountVestingPools) []*types.AccountVestingPools

Types

type C4eVestingKeeperUtils added in v1.1.0

type C4eVestingKeeperUtils struct {
	// contains filtered or unexported fields
}

func NewC4eVestingKeeperUtils added in v1.1.0

func NewC4eVestingKeeperUtils(t *testing.T, helperCfevestingKeeper *cfevestingmodulekeeper.Keeper) C4eVestingKeeperUtils

func (*C4eVestingKeeperUtils) CheckModuleAccountInvariant added in v1.1.0

func (h *C4eVestingKeeperUtils) CheckModuleAccountInvariant(ctx sdk.Context, failed bool, message string)

func (*C4eVestingKeeperUtils) CheckNonNegativeVestingPoolAmountsInvariant added in v1.1.0

func (h *C4eVestingKeeperUtils) CheckNonNegativeVestingPoolAmountsInvariant(ctx sdk.Context, failed bool, message string)

func (*C4eVestingKeeperUtils) CheckVestingPoolConsistentDataInvariant added in v1.1.0

func (h *C4eVestingKeeperUtils) CheckVestingPoolConsistentDataInvariant(ctx sdk.Context, failed bool, message string)

func (*C4eVestingKeeperUtils) GetC4eVestingKeeper added in v1.1.0

func (h *C4eVestingKeeperUtils) GetC4eVestingKeeper() *cfevestingmodulekeeper.Keeper

func (*C4eVestingKeeperUtils) SetupAccountVestingPools added in v1.1.0

func (h *C4eVestingKeeperUtils) SetupAccountVestingPools(ctx sdk.Context, address string, numberOfVestingPools int, vestingAmount sdk.Int, withdrawnAmount sdk.Int) cfevestingtypes.AccountVestingPools

func (*C4eVestingKeeperUtils) SetupAccountVestingPoolsWithModification added in v1.1.0

func (h *C4eVestingKeeperUtils) SetupAccountVestingPoolsWithModification(ctx sdk.Context, modifyVesting func(*cfevestingtypes.VestingPool), address string, numberOfVestingPools int, vestingAmount sdk.Int, withdrawnAmount sdk.Int) cfevestingtypes.AccountVestingPools

type C4eVestingUtils added in v1.1.0

type C4eVestingUtils struct {
	C4eVestingKeeperUtils
	// contains filtered or unexported fields
}

func NewC4eVestingUtils added in v1.1.0

func NewC4eVestingUtils(t *testing.T, helperCfevestingKeeper *cfevestingmodulekeeper.Keeper,
	helperAccountKeeper *authkeeper.AccountKeeper,
	helperBankKeeper *bankkeeper.Keeper,
	helperStakingKeeper *stakingkeeper.Keeper, bankUtils *commontestutils.BankUtils,
	authUtils *commontestutils.AuthUtils) C4eVestingUtils

func (*C4eVestingUtils) CompareStoredAcountVestingPools added in v1.1.0

func (h *C4eVestingUtils) CompareStoredAcountVestingPools(ctx sdk.Context, address sdk.AccAddress, accVestingPools cfevestingtypes.AccountVestingPools)

func (*C4eVestingUtils) ExportGenesis added in v1.1.0

func (h *C4eVestingUtils) ExportGenesis(ctx sdk.Context, expected cfevestingtypes.GenesisState)

func (*C4eVestingUtils) ExportGenesisAndValidate added in v1.1.0

func (m *C4eVestingUtils) ExportGenesisAndValidate(ctx sdk.Context)

func (*C4eVestingUtils) InitGenesis added in v1.1.0

func (h *C4eVestingUtils) InitGenesis(ctx sdk.Context, genState cfevestingtypes.GenesisState)

func (*C4eVestingUtils) InitGenesisError added in v1.1.0

func (h *C4eVestingUtils) InitGenesisError(ctx sdk.Context, genState cfevestingtypes.GenesisState, errorMessage string)

func (*C4eVestingUtils) MessageCreateVestingAccount added in v1.1.0

func (h *C4eVestingUtils) MessageCreateVestingAccount(
	ctx sdk.Context,
	fromAddress sdk.AccAddress,
	toAddress sdk.AccAddress,
	coins sdk.Coins,
	startTime time.Time,
	endTime time.Time,
	amountBefore sdk.Int,
)

func (*C4eVestingUtils) MessageCreateVestingAccountError added in v1.1.0

func (h *C4eVestingUtils) MessageCreateVestingAccountError(
	ctx sdk.Context,
	fromAddress sdk.AccAddress,
	toAddress sdk.AccAddress,
	amount sdk.Coins,
	startTime time.Time,
	endTime time.Time,
	amountBefore sdk.Int,
	errorMessage string,
)

func (*C4eVestingUtils) MessageCreateVestingPool added in v1.1.0

func (h *C4eVestingUtils) MessageCreateVestingPool(ctx sdk.Context, address sdk.AccAddress, accountVestingPoolsExistsBefore bool, accountVestingPoolsExistsAfter bool,
	vestingPoolName string, lockupDuration time.Duration, vestingType cfevestingtypes.VestingType, amountToVest sdk.Int, accAmountBefore sdk.Int, moduleAmountBefore sdk.Int,
	accAmountAfter sdk.Int, moduleAmountAfter sdk.Int)

func (*C4eVestingUtils) MessageCreateVestingPoolError added in v1.1.0

func (h *C4eVestingUtils) MessageCreateVestingPoolError(ctx sdk.Context, address sdk.AccAddress,
	vestingPoolName string, lockupDuration time.Duration, vestingType cfevestingtypes.VestingType, amountToVest sdk.Int,
	errorMessage string)

func (*C4eVestingUtils) MessageSendToVestingAccount added in v1.1.0

func (h *C4eVestingUtils) MessageSendToVestingAccount(ctx sdk.Context, fromAddress sdk.AccAddress, vestingAccAddress sdk.AccAddress, vestingPoolName string, amount sdk.Int, restartVesting bool, expectedLocked sdk.Int)

func (*C4eVestingUtils) MessageSendToVestingAccountError added in v1.1.0

func (h *C4eVestingUtils) MessageSendToVestingAccountError(ctx sdk.Context, fromAddress sdk.AccAddress, vestingAccAddress sdk.AccAddress, vestingPoolName string, amount sdk.Int, restartVesting bool, errorMessage string)

func (*C4eVestingUtils) MessageWithdrawAllAvailable added in v1.1.0

func (h *C4eVestingUtils) MessageWithdrawAllAvailable(ctx sdk.Context, address sdk.AccAddress, accountBalanceBefore sdk.Int, moduleBalanceBefore sdk.Int,
	expectedWithdrawn sdk.Int)

func (*C4eVestingUtils) MessageWithdrawAllAvailableError added in v1.1.0

func (h *C4eVestingUtils) MessageWithdrawAllAvailableError(ctx sdk.Context, address string, errorMessage string)

func (*C4eVestingUtils) QueryVestingsSummary added in v1.1.0

func (h *C4eVestingUtils) QueryVestingsSummary(wctx context.Context, expectedResponse cfevestingtypes.QueryVestingsSummaryResponse)

func (*C4eVestingUtils) SetVestingTypes added in v1.1.0

func (h *C4eVestingUtils) SetVestingTypes(ctx sdk.Context, vestingTypes cfevestingtypes.VestingTypes)

func (*C4eVestingUtils) SetupVestingTypes added in v1.1.0

func (h *C4eVestingUtils) SetupVestingTypes(ctx sdk.Context, numberOfVestingTypes int, amountOf10BasedVestingTypes int, startId int) cfevestingtypes.VestingTypes

func (*C4eVestingUtils) SetupVestingTypesForAccountsVestingPools added in v1.1.0

func (h *C4eVestingUtils) SetupVestingTypesForAccountsVestingPools(ctx sdk.Context)

func (*C4eVestingUtils) SetupVestingTypesWithModification added in v1.1.0

func (h *C4eVestingUtils) SetupVestingTypesWithModification(ctx sdk.Context, modifyVestingType func(*cfevestingtypes.VestingType), numberOfVestingTypes int, amountOf10BasedVestingTypes int, startId int) cfevestingtypes.VestingTypes

func (*C4eVestingUtils) ValidateInvariants added in v1.1.0

func (m *C4eVestingUtils) ValidateInvariants(ctx sdk.Context)

func (*C4eVestingUtils) VerifyAccountVestingPools added in v1.1.0

func (h *C4eVestingUtils) VerifyAccountVestingPools(ctx sdk.Context, address sdk.AccAddress,
	vestingNames []string, durations []time.Duration, vestingTypes []cfevestingtypes.VestingType, vestedAmounts []sdk.Int, withdrawnAmounts []sdk.Int, startAndModificationTime ...time.Time)

func (*C4eVestingUtils) VerifyAccountVestingPoolsWithModification added in v1.1.0

func (h *C4eVestingUtils) VerifyAccountVestingPoolsWithModification(ctx sdk.Context, address sdk.AccAddress,
	amountOfAllAccVestingPools int, vestingNames []string, durations []time.Duration, vestingTypes []cfevestingtypes.VestingType, startsTimes []time.Time, vestedAmounts []sdk.Int, withdrawnAmounts []sdk.Int,
	sentAmounts []int64, modificationsTimes []time.Time, modificationsVested []sdk.Int, modificationsWithdrawn []sdk.Int)

func (*C4eVestingUtils) VerifyVestingPool added in v1.1.0

func (h *C4eVestingUtils) VerifyVestingPool(ctx sdk.Context, vp *cfevestingtypes.VestingPool, expectedName string,
	expectedVestingType string, expectedLockStart time.Time, expectedLockEnd time.Time, expectedInitiallyLocked sdk.Int,
	expectedWithdrawn sdk.Int, expectedSent sdk.Int)

type ContextC4eVestingUtils added in v1.1.0

type ContextC4eVestingUtils struct {
	C4eVestingUtils
	// contains filtered or unexported fields
}

func NewContextC4eVestingUtils added in v1.1.0

func NewContextC4eVestingUtils(t *testing.T, testContext commontestutils.TestContext, helperCfevestingKeeper *cfevestingmodulekeeper.Keeper,
	helperAccountKeeper *authkeeper.AccountKeeper,
	helperBankKeeper *bankkeeper.Keeper,
	helperStakingKeeper *stakingkeeper.Keeper, bankUtils *commontestutils.BankUtils,
	authUtils *commontestutils.AuthUtils) *ContextC4eVestingUtils

func (*ContextC4eVestingUtils) CheckModuleAccountInvariant added in v1.1.0

func (h *ContextC4eVestingUtils) CheckModuleAccountInvariant(failed bool, message string)

func (*ContextC4eVestingUtils) CompareStoredAcountVestingPools added in v1.1.0

func (h *ContextC4eVestingUtils) CompareStoredAcountVestingPools(address sdk.AccAddress, accVestingPools cfevestingtypes.AccountVestingPools)

func (*ContextC4eVestingUtils) ExportGenesis added in v1.1.0

func (h *ContextC4eVestingUtils) ExportGenesis(expected cfevestingtypes.GenesisState)

func (*ContextC4eVestingUtils) InitGenesis added in v1.1.0

func (h *ContextC4eVestingUtils) InitGenesis(genState cfevestingtypes.GenesisState)

func (*ContextC4eVestingUtils) InitGenesisError added in v1.1.0

func (h *ContextC4eVestingUtils) InitGenesisError(genState cfevestingtypes.GenesisState, errorMessage string)

func (*ContextC4eVestingUtils) MessageCreateVestingAccount added in v1.1.0

func (h *ContextC4eVestingUtils) MessageCreateVestingAccount(
	fromAddress sdk.AccAddress,
	toAddress sdk.AccAddress,
	coins sdk.Coins,
	startTime time.Time,
	endTime time.Time,
	amountBefore sdk.Int,
)

func (*ContextC4eVestingUtils) MessageCreateVestingAccountError added in v1.1.0

func (h *ContextC4eVestingUtils) MessageCreateVestingAccountError(
	fromAddress sdk.AccAddress,
	toAddress sdk.AccAddress,
	amount sdk.Coins,
	startTime time.Time,
	endTime time.Time,
	amountBefore sdk.Int,
	errorMessage string,
)

func (*ContextC4eVestingUtils) MessageCreateVestingPool added in v1.1.0

func (h *ContextC4eVestingUtils) MessageCreateVestingPool(address sdk.AccAddress, accountVestingPoolsExistsBefore bool, accountVestingPoolsExistsAfter bool,
	vestingPoolName string, lockupDuration time.Duration, vestingType cfevestingtypes.VestingType, amountToVest sdk.Int, accAmountBefore sdk.Int, moduleAmountBefore sdk.Int,
	accAmountAfter sdk.Int, moduleAmountAfter sdk.Int)

func (*ContextC4eVestingUtils) MessageCreateVestingPoolError added in v1.1.0

func (h *ContextC4eVestingUtils) MessageCreateVestingPoolError(address sdk.AccAddress,
	vestingPoolName string, lockupDuration time.Duration, vestingType cfevestingtypes.VestingType, amountToVest sdk.Int,
	errorMessage string)

func (*ContextC4eVestingUtils) MessageSendToVestingAccount added in v1.1.0

func (h *ContextC4eVestingUtils) MessageSendToVestingAccount(fromAddress sdk.AccAddress, vestingAccAddress sdk.AccAddress, vestingPoolName string, amount sdk.Int, restartVesting bool, expectedLocked sdk.Int)

func (*ContextC4eVestingUtils) MessageSendToVestingAccountError added in v1.1.0

func (h *ContextC4eVestingUtils) MessageSendToVestingAccountError(fromAddress sdk.AccAddress, vestingAccAddress sdk.AccAddress, vestingPoolName string, amount sdk.Int, restartVesting bool, errorMessage string)

func (*ContextC4eVestingUtils) MessageWithdrawAllAvailable added in v1.1.0

func (h *ContextC4eVestingUtils) MessageWithdrawAllAvailable(address sdk.AccAddress, accountBalanceBefore sdk.Int, moduleBalanceBefore sdk.Int,
	expectedWithdrawn sdk.Int)

func (*ContextC4eVestingUtils) MessageWithdrawAllAvailableError added in v1.1.0

func (h *ContextC4eVestingUtils) MessageWithdrawAllAvailableError(address string, errorMessage string)

func (*ContextC4eVestingUtils) QueryVestings added in v1.1.0

func (h *ContextC4eVestingUtils) QueryVestings(expectedResponse cfevestingtypes.QueryVestingsSummaryResponse)

func (*ContextC4eVestingUtils) SetVestingTypes added in v1.1.0

func (h *ContextC4eVestingUtils) SetVestingTypes(vestingTypes cfevestingtypes.VestingTypes)

func (*ContextC4eVestingUtils) SetupAccountVestingPools added in v1.1.0

func (h *ContextC4eVestingUtils) SetupAccountVestingPools(address string, numberOfVestingPools int, vestingAmount sdk.Int, withdrawnAmount sdk.Int) cfevestingtypes.AccountVestingPools

func (*ContextC4eVestingUtils) SetupAccountVestingsPoolsWithModification added in v1.1.0

func (h *ContextC4eVestingUtils) SetupAccountVestingsPoolsWithModification(modifyVesting func(*cfevestingtypes.VestingPool), address string, numberOfVestingPools int, vestingAmount sdk.Int, withdrawnAmount sdk.Int) cfevestingtypes.AccountVestingPools

func (*ContextC4eVestingUtils) SetupVestingTypes added in v1.1.0

func (h *ContextC4eVestingUtils) SetupVestingTypes(numberOfVestingTypes int, amountOf10BasedVestingTypes int, startId int) cfevestingtypes.VestingTypes

func (*ContextC4eVestingUtils) SetupVestingTypesForAccountsVestingPools added in v1.1.0

func (h *ContextC4eVestingUtils) SetupVestingTypesForAccountsVestingPools()

func (*ContextC4eVestingUtils) SetupVestingTypesWithModification added in v1.1.0

func (h *ContextC4eVestingUtils) SetupVestingTypesWithModification(modifyVestingType func(*cfevestingtypes.VestingType), numberOfVestingTypes int, amountOf10BasedVestingTypes int, startId int) cfevestingtypes.VestingTypes

func (*ContextC4eVestingUtils) ValidateGenesisAndInvariants added in v1.1.0

func (m *ContextC4eVestingUtils) ValidateGenesisAndInvariants()

func (*ContextC4eVestingUtils) VerifyAccountVestingPools added in v1.1.0

func (h *ContextC4eVestingUtils) VerifyAccountVestingPools(address sdk.AccAddress,
	vestingNames []string, durations []time.Duration, vestingTypes []cfevestingtypes.VestingType, vestedAmounts []sdk.Int, withdrawnAmounts []sdk.Int, startAndModificationTime ...time.Time)

func (*ContextC4eVestingUtils) VerifyAccountVestingPoolsWithModification added in v1.1.0

func (h *ContextC4eVestingUtils) VerifyAccountVestingPoolsWithModification(address sdk.AccAddress,
	amountOfAllAccVestingPools int, vestingNames []string, durations []time.Duration, vestingTypes []cfevestingtypes.VestingType, startsTimes []time.Time, vestedAmounts []sdk.Int, withdrawnAmounts []sdk.Int,
	sentAmounts []int64, modificationsTimes []time.Time, modificationsVested []sdk.Int, modificationsWithdrawn []sdk.Int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL