keeper

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrChainNotFound                               = whoops.Errorf("chain with chainReferenceID '%s' was not found")
	ErrChainNotActive                              = whoops.Errorf("chain with chainReferenceID '%s' is not active")
	ErrNotEnoughValidatorsForGivenChainReferenceID = whoops.String("not enough validators in the current snapshot to form a proper valset")
	ErrUnexpectedError                             = whoops.String("unexpected error")
	ErrConsensusNotAchieved                        = whoops.String("evm: consensus not achieved")
	ErrCannotAddSupportForChainThatExists          = whoops.Errorf("chain info already exists: %s")
	ErrCannotActiveSmartContractThatIsNotDeploying = whoops.String("trying to activate a smart contract that is not currently deploying")
)
View Source
const (
	ConsensusTurnstoneMessage     = "evm-turnstone-message"
	ConsensusGetValidatorBalances = "validators-balances"
	ConsensusCollectFundEvents    = "collect-fund-events"
	SignaturePrefix               = "\x19Ethereum Signed Message:\n32"
)

Variables

View Source
var SupportedConsensusQueues = []supportedChainInfo{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

type Keeper struct {
	ConsensusKeeper types.ConsensusKeeper
	Scheduler       types.JobScheduler
	Valset          types.ValsetKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,
) *Keeper

func (Keeper) ActivateChainReferenceID

func (k Keeper) ActivateChainReferenceID(
	ctx sdk.Context,
	chainReferenceID string,
	smartContract *types.SmartContract,
	smartContractAddr string,
	smartContractUniqueID []byte,
) (retErr error)

func (Keeper) AddSmartContractExecutionToConsensus

func (k Keeper) AddSmartContractExecutionToConsensus(
	ctx sdk.Context,
	chainReferenceID,
	turnstoneID string,
	logicCall *types.SubmitLogicCall,
) error

func (Keeper) AddSupportForNewChain

func (k Keeper) AddSupportForNewChain(
	ctx sdk.Context,
	chainReferenceID string,
	chainID uint64,
	blockHeight uint64,
	blockHashAtHeight string,
	minimumOnChainBalance *big.Int,
) error

func (Keeper) AllSmartContractsDeployments added in v0.6.0

func (k Keeper) AllSmartContractsDeployments(ctx sdk.Context) ([]*types.SmartContractDeployment, error)

func (Keeper) ChangeMinOnChainBalance added in v0.8.0

func (k Keeper) ChangeMinOnChainBalance(ctx sdk.Context, chainReferenceID string, balance *big.Int) error

func (Keeper) CheckExternalBalancesForChain added in v0.6.0

func (k Keeper) CheckExternalBalancesForChain(ctx sdk.Context, chainReferenceID string) error

func (Keeper) CollectJobFundEvents added in v0.10.2

func (k Keeper) CollectJobFundEvents(ctx sdk.Context) error

func (Keeper) ExecuteJob added in v0.10.0

func (k Keeper) ExecuteJob(ctx sdk.Context, definition, payload []byte, chainReferenceID xchain.ReferenceID) error

ExecuteJob schedules the definition and payload for execution via consensus queue

func (Keeper) GetAllChainInfos

func (k Keeper) GetAllChainInfos(ctx sdk.Context) ([]*types.ChainInfo, error)

func (Keeper) GetChainInfo

func (k Keeper) GetChainInfo(ctx sdk.Context, targetChainReferenceID string) (*types.ChainInfo, error)

func (Keeper) GetLastSmartContract

func (k Keeper) GetLastSmartContract(ctx sdk.Context) (*types.SmartContract, error)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetValsetByID

GetValsetByID returns the valset given chain id and valset id. if the valset id is non-pozitive then it returns the latest valset existing.

func (Keeper) HasAnySmartContractDeployment

func (k Keeper) HasAnySmartContractDeployment(ctx sdk.Context, chainReferenceID string) (found bool)

func (Keeper) Logger

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

func (Keeper) ModuleName added in v0.6.0

func (k Keeper) ModuleName() string

func (Keeper) OnSnapshotBuilt

func (k Keeper) OnSnapshotBuilt(ctx sdk.Context, snapshot *valsettypes.Snapshot)

func (Keeper) Params

func (Keeper) QueryGetSmartContract added in v0.6.0

func (Keeper) QueryGetSmartContractDeployments added in v0.6.0

func (Keeper) RemoveSmartContractDeployment added in v0.6.0

func (k Keeper) RemoveSmartContractDeployment(ctx sdk.Context, smartContractID uint64, chainReferenceID string)

func (Keeper) RemoveSupportForChain

func (k Keeper) RemoveSupportForChain(ctx sdk.Context, proposal *types.RemoveChainProposal) error

func (Keeper) SaveNewSmartContract

func (k Keeper) SaveNewSmartContract(ctx sdk.Context, abiJSON string, bytecode []byte) (*types.SmartContract, error)

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SupportedQueues

func (k Keeper) SupportedQueues(ctx sdk.Context) ([]consensus.SupportsConsensusQueueAction, error)

func (Keeper) TryDeployingLastSmartContractToAllChains

func (k Keeper) TryDeployingLastSmartContractToAllChains(ctx sdk.Context)

func (Keeper) VerifyJob added in v0.10.0

func (k Keeper) VerifyJob(ctx sdk.Context, definition, payload []byte, chainReferenceID xchain.ReferenceID) error

func (Keeper) XChainReferenceIDs added in v0.10.0

func (k Keeper) XChainReferenceIDs(ctx sdk.Context) []xchain.ReferenceID

func (Keeper) XChainType added in v0.10.0

func (k Keeper) XChainType() xchain.Type

Jump to

Keyboard shortcuts

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