keeper

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 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")

	ErrWasmExecuteMessageNotValid = whoops.String("message is not valid")
)
View Source
const (
	ConsensusTurnstoneMessage     = "evm-turnstone-message"
	ConsensusGetValidatorBalances = "validators-balances"
	SignaturePrefix               = "\x19Ethereum Signed Message:\n32"
)

Variables

View Source
var SupportedConsensusQueues = map[string]supportedChainInfo{
	ConsensusTurnstoneMessage: {
		// contains filtered or unexported fields
	},
	ConsensusGetValidatorBalances: {
		// 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 ExecuteEVMFromCosmWasm added in v0.9.0

type ExecuteEVMFromCosmWasm struct {
	TargetContractInfo struct {
		ChainReferenceID     string `json:"chain_id"`
		SmartContractAddress string `json:"contract_address"`
		SmartContractABI     string `json:"smart_contract_abi"`

		CompassID string `json:"compass_id"`
	} `json:"target_contract_info"`

	Payload []byte `json:"payload"`
}

type Keeper

type Keeper struct {
	ConsensusKeeper types.ConsensusKeeper
	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) ChainReferenceIDs added in v0.8.0

func (k Keeper) ChainReferenceIDs(ctx sdk.Context) []string

func (Keeper) ChainType added in v0.8.0

func (k Keeper) ChainType(_ sdk.Context) string

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) 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) (map[string]consensus.SupportsConsensusQueueAction, error)

func (Keeper) TryDeployingLastSmartContractToAllChains

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

func (Keeper) WasmMessengerHandler

func (k Keeper) WasmMessengerHandler() wasmutil.MessengerFnc

Jump to

Keyboard shortcuts

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