keeper

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountWithoutCampaignInvariant

func AccountWithoutCampaignInvariant(k Keeper) sdk.Invariant

AccountWithoutCampaignInvariant invariant that checks if the `MainnetAccount` campaign exist.

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func CampaignSharesInvariant

func CampaignSharesInvariant(k Keeper) sdk.Invariant

CampaignSharesInvariant invariant that checks, for all campaigns, if the amount of allocated shares is equal to the sum of `MainnetVestingAccount` and `MainnetAccount` shares plus the amount of vouchers in circulation

func GetCampaignIDBytes

func GetCampaignIDBytes(id uint64) []byte

GetCampaignIDBytes returns the byte representation of the ID

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all module invariants

func VestingAccountWithoutCampaignInvariant

func VestingAccountWithoutCampaignInvariant(k Keeper) sdk.Invariant

VestingAccountWithoutCampaignInvariant invariant that checks if the `MainnetVestingAccount` campaign exist.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	paramSpace paramtypes.Subspace,
	launchKeeper LaunchKeeper,
	bankKeeper types.BankKeeper,
	distrKeeper types.DistributionKeeper,
	profileKeeper types.ProfileKeeper,
	rewardKeeper RewardKeeper,
) *Keeper

func (Keeper) AddChainToCampaign

func (k Keeper) AddChainToCampaign(ctx sdk.Context, campaignID, launchID uint64) error

AddChainToCampaign adds a new chain into an existing campaign

func (Keeper) AppendCampaign

func (k Keeper) AppendCampaign(ctx sdk.Context, campaign types.Campaign) uint64

AppendCampaign appends a campaign in the store with a new id and update the count

func (Keeper) CampaignCreationFee

func (k Keeper) CampaignCreationFee(ctx sdk.Context) (campaignCreationFee sdk.Coins)

CampaignCreationFee returns the campaign creation fee param

func (Keeper) GetAllCampaign

func (k Keeper) GetAllCampaign(ctx sdk.Context) (list []types.Campaign)

GetAllCampaign returns all campaign

func (Keeper) GetAllCampaignChains

func (k Keeper) GetAllCampaignChains(ctx sdk.Context) (list []types.CampaignChains)

GetAllCampaignChains returns all campaignChains

func (Keeper) GetAllMainnetAccount

func (k Keeper) GetAllMainnetAccount(ctx sdk.Context) (list []types.MainnetAccount)

GetAllMainnetAccount returns all mainnetAccount

func (Keeper) GetAllMainnetVestingAccount

func (k Keeper) GetAllMainnetVestingAccount(ctx sdk.Context) (list []types.MainnetVestingAccount)

GetAllMainnetVestingAccount returns all mainnetVestingAccount

func (Keeper) GetCampaign

func (k Keeper) GetCampaign(ctx sdk.Context, id uint64) (val types.Campaign, found bool)

GetCampaign returns a campaign from its id

func (Keeper) GetCampaignChains

func (k Keeper) GetCampaignChains(ctx sdk.Context, campaignID uint64) (val types.CampaignChains, found bool)

GetCampaignChains returns a campaignChains from its index

func (Keeper) GetCampaignCounter

func (k Keeper) GetCampaignCounter(ctx sdk.Context) uint64

GetCampaignCounter get the counter for campaign

func (Keeper) GetCampaignSummary

func (k Keeper) GetCampaignSummary(ctx sdk.Context, campaign types.Campaign) (cs types.CampaignSummary, err error)

GetCampaignSummary returns the campaign with summary attached to it like most recent chain and rewards attached to it TODO: add tests https://github.com/tendermint/spn/issues/650

func (Keeper) GetMainnetAccount

func (k Keeper) GetMainnetAccount(
	ctx sdk.Context,
	campaignID uint64,
	address string,
) (val types.MainnetAccount, found bool)

GetMainnetAccount returns a mainnetAccount from its index

func (Keeper) GetMainnetVestingAccount

func (k Keeper) GetMainnetVestingAccount(
	ctx sdk.Context,
	campaignID uint64,
	address string,
) (val types.MainnetVestingAccount, found bool)

GetMainnetVestingAccount returns a mainnetVestingAccount from its index

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of campaign parameters.

func (Keeper) GetTotalShares

func (k Keeper) GetTotalShares(ctx sdk.Context) uint64

GetTotalShares gets the total shares value

func (Keeper) IsCampaignMainnetLaunchTriggered

func (k Keeper) IsCampaignMainnetLaunchTriggered(ctx sdk.Context, campaignID uint64) (bool, error)

IsCampaignMainnetLaunchTriggered returns true if the provided campaign has an associated mainnet chain whose launch has been already triggered

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (Keeper) RemoveMainnetAccount

func (k Keeper) RemoveMainnetAccount(
	ctx sdk.Context,
	campaignID uint64,
	address string,
)

RemoveMainnetAccount removes a mainnetAccount from the store

func (Keeper) RemoveMainnetVestingAccount

func (k Keeper) RemoveMainnetVestingAccount(
	ctx sdk.Context,
	campaignID uint64,
	address string,
)

RemoveMainnetVestingAccount removes a mainnetVestingAccount from the store

func (Keeper) SetCampaign

func (k Keeper) SetCampaign(ctx sdk.Context, campaign types.Campaign)

SetCampaign set a specific campaign in the store

func (Keeper) SetCampaignChains

func (k Keeper) SetCampaignChains(ctx sdk.Context, campaignChains types.CampaignChains)

SetCampaignChains set a specific campaignChains in the store from its index

func (Keeper) SetCampaignCounter

func (k Keeper) SetCampaignCounter(ctx sdk.Context, counter uint64)

SetCampaignCounter set the counter for campaign

func (Keeper) SetMainnetAccount

func (k Keeper) SetMainnetAccount(ctx sdk.Context, mainnetAccount types.MainnetAccount)

SetMainnetAccount set a specific mainnetAccount in the store from its index

func (Keeper) SetMainnetVestingAccount

func (k Keeper) SetMainnetVestingAccount(ctx sdk.Context, mainnetVestingAccount types.MainnetVestingAccount)

SetMainnetVestingAccount set a specific mainnetVestingAccount in the store from its index

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the campaign parameters to the param space.

func (Keeper) SetTotalShares

func (k Keeper) SetTotalShares(ctx sdk.Context, numShares uint64)

SetTotalShares sets the total shares value

func (Keeper) TotalSupplyRange

func (k Keeper) TotalSupplyRange(ctx sdk.Context) (totalSupplyRange types.TotalSupplyRange)

TotalSupplyRange returns the param that defines the allowed range for total supply

type LaunchKeeper

type LaunchKeeper interface {
	GetChain(ctx sdk.Context, launchID uint64) (val launchtypes.Chain, found bool)
	GetRequestCounter(ctx sdk.Context, launchID uint64) (count uint64)
	GetGenesisValidatorCount(ctx sdk.Context, launchID uint64) (count uint64)
	CreateNewChain(
		ctx sdk.Context,
		coordinatorID uint64,
		genesisChainID,
		sourceURL,
		sourceHash,
		genesisURL,
		genesisHash string,
		hasCampaign bool,
		campaignID uint64,
		isMainnet bool,
		metadata []byte,
	) (uint64, error)
}

type RewardKeeper

type RewardKeeper interface {
	GetRewardPool(ctx sdk.Context, launchID uint64) (val rewardtypes.RewardPool, found bool)
}

Jump to

Keyboard shortcuts

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