keeper

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants added in v0.2.0

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func ApplyRequest

func ApplyRequest(
	ctx sdk.Context,
	k Keeper,
	chain types.Chain,
	request types.Request,
	coord profiletypes.Coordinator,
) error

ApplyRequest approves the request and performs the launch information changes

func CheckAccount added in v0.2.0

func CheckAccount(ctx sdk.Context, k Keeper, launchID uint64, address string) (bool, error)

CheckAccount check account inconsistency and return if an account exists for genesis or vesting accounts

func CheckRequest added in v0.2.0

func CheckRequest(
	ctx sdk.Context,
	k Keeper,
	launchID uint64,
	request types.Request,
) error

CheckRequest verifies that a request can be applied

func DuplicatedAccountInvariant added in v0.2.0

func DuplicatedAccountInvariant(k Keeper) sdk.Invariant

DuplicatedAccountInvariant invariant that checks if the `GenesisAccount` exists into the `VestingAccount` store

func InvalidChainInvariant added in v0.2.0

func InvalidChainInvariant(k Keeper) sdk.Invariant

InvalidChainInvariant invariant that checks all chain in the store are valid

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func RegisterInvariants added in v0.2.0

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all module invariants

func UnknownRequestTypeInvariant added in v0.2.0

func UnknownRequestTypeInvariant(k Keeper) sdk.Invariant

UnknownRequestTypeInvariant invariant that checks if the Request type is valid

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	distrKeeper types.DistributionKeeper,
	profileKeeper types.ProfileKeeper,
) *Keeper

func (Keeper) AppendChain

func (k Keeper) AppendChain(ctx sdk.Context, chain types.Chain) uint64

AppendChain appends a chain in the store with a new id and update the counter

func (Keeper) AppendRequest

func (k Keeper) AppendRequest(ctx sdk.Context, request types.Request) uint64

AppendRequest appends a request for a chain in the store with a new id and update the counter

func (Keeper) ChainCreationFee added in v0.2.0

func (k Keeper) ChainCreationFee(ctx sdk.Context) (chainCreationFee sdk.Coins)

ChainCreationFee returns the chain creation fee param

func (Keeper) CheckValidatorSet added in v0.2.0

func (k Keeper) CheckValidatorSet(
	ctx sdk.Context,
	launchID uint64,
	chainID string,
	validatorSet tmtypes.ValidatorSet,
) error

CheckValidatorSet checks the information about a validator set (used to create an IBC client) is valid

func (Keeper) CreateNewChain added in v0.2.0

func (k Keeper) CreateNewChain(
	ctx sdk.Context,
	coordinatorID uint64,
	genesisChainID,
	sourceURL,
	sourceHash string,
	initialGenesis types.InitialGenesis,
	hasProject bool,
	projectID uint64,
	isMainnet bool,
	accountBalance sdk.Coins,
	metadata []byte,
) (uint64, error)

CreateNewChain creates a new chain in the store from the provided information

func (Keeper) EnableMonitoringConnection added in v0.2.0

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

EnableMonitoringConnection sets a chain with MonitoringConnected set to true

func (Keeper) GetAllChain

func (k Keeper) GetAllChain(ctx sdk.Context) (list []types.Chain)

GetAllChain returns all chain

func (Keeper) GetAllGenesisAccount

func (k Keeper) GetAllGenesisAccount(ctx sdk.Context) (list []types.GenesisAccount)

GetAllGenesisAccount returns all genesisAccount

func (Keeper) GetAllGenesisValidator

func (k Keeper) GetAllGenesisValidator(ctx sdk.Context) (list []types.GenesisValidator)

GetAllGenesisValidator returns all genesisValidator

func (Keeper) GetAllParamChange added in v0.3.0

func (k Keeper) GetAllParamChange(ctx sdk.Context) (list []types.ParamChange)

GetAllParamChange returns all ParamChange

func (Keeper) GetAllRequest

func (k Keeper) GetAllRequest(ctx sdk.Context) (list []types.Request)

GetAllRequest returns all request

func (Keeper) GetAllVestingAccount

func (k Keeper) GetAllVestingAccount(ctx sdk.Context) (list []types.VestingAccount)

GetAllVestingAccount returns all vestingAccount

func (Keeper) GetChain

func (k Keeper) GetChain(ctx sdk.Context, launchID uint64) (val types.Chain, found bool)

GetChain returns a chain from its index

func (Keeper) GetChainCounter added in v0.2.0

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

GetChainCounter get the counter for chains

func (Keeper) GetGenesisAccount

func (k Keeper) GetGenesisAccount(
	ctx sdk.Context,
	launchID uint64,
	address string,
) (val types.GenesisAccount, found bool)

GetGenesisAccount returns a genesisAccount from its index

func (Keeper) GetGenesisValidator

func (k Keeper) GetGenesisValidator(
	ctx sdk.Context,
	launchID uint64,
	address string,
) (val types.GenesisValidator, found bool)

GetGenesisValidator returns a genesisValidator from its index

func (*Keeper) GetMonitoringcKeeper added in v0.2.0

func (k *Keeper) GetMonitoringcKeeper() types.MonitoringConsumerKeeper

GetMonitoringcKeeper gets the monitoring consumer keeper interface of the module

func (Keeper) GetParamChange added in v0.3.0

func (k Keeper) GetParamChange(
	ctx sdk.Context,
	launchID uint64,
	module,
	param string,
) (val types.ParamChange, found bool)

GetParamChange returns a ParamChange from its index

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (*Keeper) GetProfileKeeper added in v0.2.0

func (k *Keeper) GetProfileKeeper() types.ProfileKeeper

GetProfileKeeper gets the profile keeper interface of the module

func (*Keeper) GetProjectKeeper added in v0.3.0

func (k *Keeper) GetProjectKeeper() types.ProjectKeeper

GetProjectKeeper gets the project keeper interface of the module

func (Keeper) GetRequest

func (k Keeper) GetRequest(
	ctx sdk.Context,
	launchID,
	requestID uint64,
) (val types.Request, found bool)

GetRequest returns a request from its index

func (Keeper) GetRequestCounter added in v0.2.0

func (k Keeper) GetRequestCounter(ctx sdk.Context, launchID uint64) uint64

GetRequestCounter get request counter for a specific chain ID

func (Keeper) GetValidatorsAndTotalDelegation added in v0.2.0

func (k Keeper) GetValidatorsAndTotalDelegation(
	ctx sdk.Context,
	launchID uint64,
) (map[string]types.GenesisValidator, sdk.Dec)

GetValidatorsAndTotalDelegation returns the genesisValidator map by consensus address and total of self delegation

func (Keeper) GetVestingAccount

func (k Keeper) GetVestingAccount(
	ctx sdk.Context,
	launchID uint64,
	address string,
) (val types.VestingAccount, found bool)

GetVestingAccount returns a vestingAccount from its index

func (Keeper) LaunchTimeRange added in v0.2.0

func (k Keeper) LaunchTimeRange(ctx sdk.Context) (res types.LaunchTimeRange)

LaunchTimeRange returns the launch time range param

func (Keeper) Logger

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

Logger returns a logger for the module

func (Keeper) MaxMetadataLength added in v0.3.0

func (k Keeper) MaxMetadataLength(ctx sdk.Context) (maxMetadataLength uint64)

MaxMetadataLength returns the param that defines the max metadata length

func (Keeper) ParamChangeAll added in v0.3.0

func (Keeper) Params

func (Keeper) RemoveGenesisAccount

func (k Keeper) RemoveGenesisAccount(
	ctx sdk.Context,
	launchID uint64,
	address string,
)

RemoveGenesisAccount removes a genesisAccount from the store

func (Keeper) RemoveGenesisValidator

func (k Keeper) RemoveGenesisValidator(ctx sdk.Context, launchID uint64, address string)

RemoveGenesisValidator removes a genesisValidator from the store

func (Keeper) RemoveRequest

func (k Keeper) RemoveRequest(
	ctx sdk.Context,
	launchID,
	requestID uint64,
)

RemoveRequest removes a request from the store

func (Keeper) RemoveVestingAccount

func (k Keeper) RemoveVestingAccount(
	ctx sdk.Context,
	launchID uint64,
	address string,
)

RemoveVestingAccount removes a vestingAccount from the store

func (Keeper) RequestCreated added in v0.3.0

func (k Keeper) RequestCreated(
	ctx sdk.Context,
	creator string,
	launchID,
	requestID uint64,
	content types.RequestContent,
)

RequestCreated calls associated hook if registered

func (Keeper) RequestFee added in v0.3.0

func (k Keeper) RequestFee(ctx sdk.Context) (requestFee sdk.Coins)

RequestFee returns the request fee param

func (Keeper) RevertDelay added in v0.2.0

func (k Keeper) RevertDelay(ctx sdk.Context) (res time.Duration)

RevertDelay returns the revert delay param

func (Keeper) SetChain

func (k Keeper) SetChain(ctx sdk.Context, chain types.Chain)

SetChain set a specific chain in the store from its index

func (Keeper) SetChainCounter added in v0.2.0

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

SetChainCounter set the counter for chains

func (Keeper) SetGenesisAccount

func (k Keeper) SetGenesisAccount(ctx sdk.Context, genesisAccount types.GenesisAccount)

SetGenesisAccount set a specific genesisAccount in the store from its index

func (Keeper) SetGenesisValidator

func (k Keeper) SetGenesisValidator(ctx sdk.Context, genesisValidator types.GenesisValidator)

SetGenesisValidator set a specific genesisValidator in the store from its index

func (*Keeper) SetHooks added in v0.3.0

func (k *Keeper) SetHooks(fk types.LaunchHooks) *Keeper

SetHooks sets the launch hooks

func (*Keeper) SetMonitoringcKeeper added in v0.2.0

func (k *Keeper) SetMonitoringcKeeper(monitoringcKeeper types.MonitoringConsumerKeeper)

SetMonitoringcKeeper sets the monitoring consumer keeper interface of the module

func (Keeper) SetParamChange added in v0.3.0

func (k Keeper) SetParamChange(ctx sdk.Context, paramChange types.ParamChange)

SetParamChange set a specific ParamChange in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (*Keeper) SetProjectKeeper added in v0.3.0

func (k *Keeper) SetProjectKeeper(projectKeeper types.ProjectKeeper)

SetProjectKeeper sets the project keeper interface of the module

func (Keeper) SetRequest

func (k Keeper) SetRequest(ctx sdk.Context, request types.Request)

SetRequest set a specific request in the store from its index

func (Keeper) SetRequestCounter added in v0.2.0

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

SetRequestCounter set the total number of request for a chain

func (Keeper) SetVestingAccount

func (k Keeper) SetVestingAccount(ctx sdk.Context, vestingAccount types.VestingAccount)

SetVestingAccount set a specific vestingAccount in the store from its index

Jump to

Keyboard shortcuts

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