Versions in this module Expand all Collapse all v4 v4.0.1 Feb 9, 2024 v4.0.0 Dec 11, 2023 Changes in this version + const BatchTxSize + var AccAddrs = []sdk.AccAddress + var AccPrivKeys = []ccrypto.PrivKey + var AccPubKeys = []ccrypto.PubKey + var ConsPrivKeys = []ccrypto.PrivKey + var ConsPubKeys = []ccrypto.PubKey + var EthAddrs = []gethcommon.Address + var InitCoins = sdk.NewCoins(sdk.NewCoin(TestingStakeParams.BondDenom, InitTokens)) + var InitTokens = sdk.TokensFromConsensusPower(110, sdk.DefaultPowerReduction) + var ModuleBasics = module.NewBasicManager(auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, ...) + var StakingAmount = sdk.TokensFromConsensusPower(10, sdk.DefaultPowerReduction) + var StakingCoins = sdk.NewCoins(sdk.NewCoin(TestingStakeParams.BondDenom, StakingAmount)) + var TestingGravityParams = types.Params + var TestingStakeParams = stakingtypes.Params + var TokenContractAddrs = []string + var ValAddrs = []sdk.ValAddress + func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState + func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState) + func MakeTestCodec() *codec.LegacyAmino + func MakeTestMarshaler() codec.Codec + func MintVouchersFromAir(t *testing.T, ctx sdk.Context, k Keeper, dest sdk.AccAddress, ...) sdk.Coin + func NewMsgServerImpl(keeper Keeper) types.MsgServer + type AlwaysPanicStakingMock struct + func (s AlwaysPanicStakingMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator + func (s AlwaysPanicStakingMock) GetLastTotalPower(ctx sdk.Context) (power sdkmath.Int) + func (s AlwaysPanicStakingMock) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) int64 + func (s AlwaysPanicStakingMock) IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + func (s AlwaysPanicStakingMock) IterateLastValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + func (s AlwaysPanicStakingMock) IterateValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + func (s AlwaysPanicStakingMock) Jail(sdk.Context, sdk.ConsAddress) + func (s AlwaysPanicStakingMock) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) + func (s AlwaysPanicStakingMock) Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI + func (s AlwaysPanicStakingMock) ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI + type Hooks struct + func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, valAddress sdk.ValAddress) error + func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error + func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error + func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error + func (h Hooks) BeforeDelegationCreated(_ sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error + func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error + func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error + type Keeper struct + DistributionKeeper types.DistributionKeeper + PowerReduction sdkmath.Int + ReceiverModuleAccounts map[string]string + SenderModuleAccounts map[string]string + SlashingKeeper types.SlashingKeeper + StakingKeeper types.StakingKeeper + func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, ...) Keeper + func (k *Keeper) SetHooks(sh types.GravityHooks) *Keeper + func (k Keeper) AfterBatchExecutedEvent(ctx sdk.Context, event types.BatchExecutedEvent) + func (k Keeper) AfterContractCallExecutedEvent(ctx sdk.Context, event types.ContractCallExecutedEvent) + func (k Keeper) AfterERC20DeployedEvent(ctx sdk.Context, event types.ERC20DeployedEvent) + func (k Keeper) AfterSendToCosmosEvent(ctx sdk.Context, event types.SendToCosmosEvent) + func (k Keeper) AfterSignerSetExecutedEvent(ctx sdk.Context, event types.SignerSetTxExecutedEvent) + func (k Keeper) BatchTx(c context.Context, req *types.BatchTxRequest) (*types.BatchTxResponse, error) + func (k Keeper) BatchTxConfirmations(c context.Context, req *types.BatchTxConfirmationsRequest) (*types.BatchTxConfirmationsResponse, error) + func (k Keeper) BatchTxConfirmationsByValidator(c context.Context, req *types.BatchTxConfirmationsByValidatorRequest) (*types.BatchTxConfirmationsByValidatorResponse, error) + func (k Keeper) BatchTxFees(c context.Context, req *types.BatchTxFeesRequest) (*types.BatchTxFeesResponse, error) + func (k Keeper) BatchTxs(c context.Context, req *types.BatchTxsRequest) (*types.BatchTxsResponse, error) + func (k Keeper) BatchedSendToEthereums(c context.Context, req *types.BatchedSendToEthereumsRequest) (*types.BatchedSendToEthereumsResponse, error) + func (k Keeper) CancelBatchTx(ctx sdk.Context, batch *types.BatchTx) + func (k Keeper) CompleteOutgoingTx(ctx sdk.Context, otx types.OutgoingTx) + func (k Keeper) CompletedBatchTxs(c context.Context, req *types.CompletedBatchTxsRequest) (*types.CompletedBatchTxsResponse, error) + func (k Keeper) CompletedContractCallTxs(c context.Context, req *types.CompletedContractCallTxsRequest) (*types.CompletedContractCallTxsResponse, error) + func (k Keeper) CompletedSignerSetTxs(c context.Context, req *types.CompletedSignerSetTxsRequest) (*types.CompletedSignerSetTxsResponse, error) + func (k Keeper) ContractCallTx(c context.Context, req *types.ContractCallTxRequest) (*types.ContractCallTxResponse, error) + func (k Keeper) ContractCallTxConfirmations(c context.Context, req *types.ContractCallTxConfirmationsRequest) (*types.ContractCallTxConfirmationsResponse, error) + func (k Keeper) ContractCallTxConfirmationsByValidator(c context.Context, req *types.ContractCallTxConfirmationsByValidatorRequest) (*types.ContractCallTxConfirmationsByValidatorResponse, error) + func (k Keeper) ContractCallTxs(c context.Context, req *types.ContractCallTxsRequest) (*types.ContractCallTxsResponse, error) + func (k Keeper) CreateBatchTx(ctx sdk.Context, contractAddress common.Address, maxElements int) *types.BatchTx + func (k Keeper) CreateContractCallTx(ctx sdk.Context, invalidationNonce uint64, invalidationScope tmbytes.HexBytes, ...) *types.ContractCallTx + func (k Keeper) CreateSignerSetTx(ctx sdk.Context) *types.SignerSetTx + func (k Keeper) CurrentSignerSet(ctx sdk.Context) types.EthereumSigners + func (k Keeper) DelegateKeys(c context.Context, req *types.DelegateKeysRequest) (*types.DelegateKeysResponse, error) + func (k Keeper) DelegateKeysByEthereumSigner(c context.Context, req *types.DelegateKeysByEthereumSignerRequest) (*types.DelegateKeysByEthereumSignerResponse, error) + func (k Keeper) DelegateKeysByOrchestrator(c context.Context, req *types.DelegateKeysByOrchestratorRequest) (*types.DelegateKeysByOrchestratorResponse, error) + func (k Keeper) DelegateKeysByValidator(c context.Context, req *types.DelegateKeysByValidatorRequest) (*types.DelegateKeysByValidatorResponse, error) + func (k Keeper) DeleteCompletedOutgoingTx(ctx sdk.Context, storeIndex []byte) + func (k Keeper) DeleteEthereumEventVoteRecord(ctx sdk.Context, eventNonce uint64, claimHash []byte) + func (k Keeper) DeleteEthereumSignatures(ctx sdk.Context, storeIndex []byte) + func (k Keeper) DeleteOutgoingTx(ctx sdk.Context, storeIndex []byte) + func (k Keeper) DenomToERC20(c context.Context, req *types.DenomToERC20Request) (*types.DenomToERC20Response, error) + func (k Keeper) DenomToERC20Lookup(ctx sdk.Context, denom string) (bool, common.Address, error) + func (k Keeper) DenomToERC20Params(c context.Context, req *types.DenomToERC20ParamsRequest) (*types.DenomToERC20ParamsResponse, error) + func (k Keeper) DetectMaliciousSupply(ctx sdk.Context, denom string, amount sdk.Int) (err error) + func (k Keeper) ERC20ToDenom(c context.Context, req *types.ERC20ToDenomRequest) (*types.ERC20ToDenomResponse, error) + func (k Keeper) ERC20ToDenomLookup(ctx sdk.Context, tokenContract common.Address) (bool, string) + func (k Keeper) EthereumEventVoteRecords(c context.Context, req *types.EthereumEventVoteRecordsRequest) (*types.EthereumEventVoteRecordsResponse, error) + func (k Keeper) EthereumEventVotes(c context.Context, req *types.EthereumEventVotesRequest) (*types.EthereumEventVotesResponse, error) + func (k Keeper) GetBatchFeesByTokenType(ctx sdk.Context, tokenContractAddr common.Address, maxElements int) sdk.Int + func (k Keeper) GetBondedValidatorSlashingInfos(ctx sdk.Context) ([]stakingtypes.Validator, []ValidatorSlashingInfo) + func (k Keeper) GetCompletedOutgoingTx(ctx sdk.Context, storeIndex []byte) (out types.OutgoingTx) + func (k Keeper) GetEthereumEventVoteRecord(ctx sdk.Context, eventNonce uint64, claimHash []byte) *types.EthereumEventVoteRecord + func (k Keeper) GetEthereumEventVoteRecordMapping(ctx sdk.Context) (out map[uint64][]*types.EthereumEventVoteRecord) + func (k Keeper) GetEthereumHeightVote(ctx sdk.Context, valAddress sdk.ValAddress) types.LatestEthereumBlockHeight + func (k Keeper) GetEthereumOrchestratorAddress(ctx sdk.Context, ethAddr common.Address) sdk.AccAddress + func (k Keeper) GetEthereumSignatures(ctx sdk.Context, storeIndex []byte) map[string][]byte + func (k Keeper) GetLastObservedEthereumBlockHeight(ctx sdk.Context) types.LatestEthereumBlockHeight + func (k Keeper) GetLastObservedEventNonce(ctx sdk.Context) uint64 + func (k Keeper) GetLastObservedSignerSetTx(ctx sdk.Context) *types.SignerSetTx + func (k Keeper) GetLastSlashedOutgoingTxBlockHeight(ctx sdk.Context) uint64 + func (k Keeper) GetLastUnbondingBlockHeight(ctx sdk.Context) uint64 + func (k Keeper) GetLatestSignerSetTx(ctx sdk.Context) *types.SignerSetTx + func (k Keeper) GetLatestSignerSetTxNonce(ctx sdk.Context) uint64 + func (k Keeper) GetOrchestratorValidatorAddress(ctx sdk.Context, orchAddr sdk.AccAddress) sdk.ValAddress + func (k Keeper) GetOutgoingTx(ctx sdk.Context, storeIndex []byte) (out types.OutgoingTx) + func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) + func (k Keeper) GetSignerSetTxs(ctx sdk.Context) (out []*types.SignerSetTx) + func (k Keeper) GetUnbondingValidatorSlashingInfos(ctx sdk.Context) ([]stakingtypes.Validator, []ValidatorSlashingInfo) + func (k Keeper) GetUnsignedBatchTxs(ctx sdk.Context, val sdk.ValAddress) []*types.BatchTx + func (k Keeper) GetUnsignedContractCallTxs(ctx sdk.Context, val sdk.ValAddress) []*types.ContractCallTx + func (k Keeper) GetUnsignedSignerSetTxs(ctx sdk.Context, val sdk.ValAddress) []*types.SignerSetTx + func (k Keeper) GetUnslashedOutgoingTxs(ctx sdk.Context, maxHeight uint64) (out []types.OutgoingTx) + func (k Keeper) GetValidatorEthereumAddress(ctx sdk.Context, valAddr sdk.ValAddress) common.Address + func (k Keeper) GetValidatorSlashingInfo(ctx sdk.Context, validator stakingtypes.Validator) ValidatorSlashingInfo + func (k Keeper) Handle(ctx sdk.Context, eve types.EthereumEvent) (err error) + func (k Keeper) HandleCommunityPoolEthereumSpendProposal(ctx sdk.Context, p *types.CommunityPoolEthereumSpendProposal) error + func (k Keeper) Hooks() Hooks + func (k Keeper) IterateBatchTxEthereumSignatures(ctx sdk.Context, cb func(common.Address, uint64, sdk.ValAddress, []byte) bool) + func (k Keeper) IterateCompletedOutgoingTxs(ctx sdk.Context, cb func(key []byte, outgoing types.OutgoingTx) bool) + func (k Keeper) IterateCompletedOutgoingTxsByType(ctx sdk.Context, prefixByte byte, ...) + func (k Keeper) IterateContractCallTxEthereumSignatures(ctx sdk.Context, cb func([]byte, uint64, sdk.ValAddress, []byte) bool) + func (k Keeper) IterateEthereumEventVoteRecords(ctx sdk.Context, cb func([]byte, *types.EthereumEventVoteRecord) bool) + func (k Keeper) IterateEthereumHeightVotes(ctx sdk.Context, ...) + func (k Keeper) IterateOutgoingTxsByType(ctx sdk.Context, prefixByte byte, ...) + func (k Keeper) IterateSignerSetTxEthereumSignatures(ctx sdk.Context, cb func(uint64, sdk.ValAddress, []byte) bool) + func (k Keeper) IterateUnbatchedSendToEthereums(ctx sdk.Context, cb func(*types.SendToEthereum) bool) + func (k Keeper) LastObservedEthereumHeight(c context.Context, req *types.LastObservedEthereumHeightRequest) (*types.LastObservedEthereumHeightResponse, error) + func (k Keeper) LastSubmittedEthereumEvent(c context.Context, req *types.LastSubmittedEthereumEventRequest) (*types.LastSubmittedEthereumEventResponse, error) + func (k Keeper) LatestSignerSetTx(c context.Context, req *types.LatestSignerSetTxRequest) (*types.SignerSetTxResponse, error) + func (k Keeper) Logger(ctx sdk.Context) log.Logger + func (k Keeper) MigrateGravityContract(ctx sdk.Context, newBridgeAddress string, bridgeDeploymentHeight uint64) + func (k Keeper) PaginateEthereumEventVoteRecords(ctx sdk.Context, pageReq *query.PageRequest, ...) (*query.PageResponse, error) + func (k Keeper) PaginateOutgoingTxsByType(ctx sdk.Context, pageReq *query.PageRequest, prefixByte byte, ...) (*query.PageResponse, error) + func (k Keeper) Params(c context.Context, req *types.ParamsRequest) (*types.ParamsResponse, error) + func (k Keeper) SetCompletedOutgoingTx(ctx sdk.Context, outgoing types.OutgoingTx) + func (k Keeper) SetEthereumHeightVote(ctx sdk.Context, valAddress sdk.ValAddress, ethereumHeight uint64) + func (k Keeper) SetEthereumSignature(ctx sdk.Context, sig types.EthereumTxConfirmation, val sdk.ValAddress) []byte + func (k Keeper) SetLastObservedEthereumBlockHeight(ctx sdk.Context, ethereumHeight uint64) + func (k Keeper) SetLastObservedEthereumBlockHeightWithCosmos(ctx sdk.Context, ethereumHeight uint64, cosmosHeight uint64) + func (k Keeper) SetLastSlashedOutgoingTxBlockHeight(ctx sdk.Context, blockHeight uint64) + func (k Keeper) SetOrchestratorValidatorAddress(ctx sdk.Context, val sdk.ValAddress, orchAddr sdk.AccAddress) + func (k Keeper) SetOutgoingTx(ctx sdk.Context, outgoing types.OutgoingTx) + func (k Keeper) SetParams(ctx sdk.Context, ps types.Params) + func (k Keeper) SignerSetExecuted(ctx sdk.Context, nonce uint64) + func (k Keeper) SignerSetTx(c context.Context, req *types.SignerSetTxRequest) (*types.SignerSetTxResponse, error) + func (k Keeper) SignerSetTxConfirmations(c context.Context, req *types.SignerSetTxConfirmationsRequest) (*types.SignerSetTxConfirmationsResponse, error) + func (k Keeper) SignerSetTxConfirmationsByValidator(c context.Context, req *types.SignerSetTxConfirmationsByValidatorRequest) (*types.SignerSetTxConfirmationsByValidatorResponse, error) + func (k Keeper) SignerSetTxs(c context.Context, req *types.SignerSetTxsRequest) (*types.SignerSetTxsResponse, error) + func (k Keeper) SlashAndJail(ctx sdk.Context, validator stakingtypes.Validator, reason string) + func (k Keeper) TryEventVoteRecord(ctx sdk.Context, eventVoteRecord *types.EthereumEventVoteRecord) + func (k Keeper) UnbatchedSendToEthereums(c context.Context, req *types.UnbatchedSendToEthereumsRequest) (*types.UnbatchedSendToEthereumsResponse, error) + func (k Keeper) UnsignedBatchTxs(c context.Context, req *types.UnsignedBatchTxsRequest) (*types.UnsignedBatchTxsResponse, error) + func (k Keeper) UnsignedContractCallTxs(c context.Context, req *types.UnsignedContractCallTxsRequest) (*types.UnsignedContractCallTxsResponse, error) + func (k Keeper) UnsignedSignerSetTxs(c context.Context, req *types.UnsignedSignerSetTxsRequest) (*types.UnsignedSignerSetTxsResponse, error) + type Migrator struct + func NewMigrator(keeper Keeper) Migrator + func (m Migrator) Migrate1to2(ctx sdk.Context) error + func (m Migrator) Migrate2to3(ctx sdk.Context) error + func (m Migrator) Migrate3to4(ctx sdk.Context) error + type MockStakingValidatorData struct + Operator sdk.ValAddress + Power int64 + type StakingKeeperMock struct + BondedValidators []stakingtypes.Validator + ValidatorPower map[string]int64 + func NewStakingKeeperMock(operators ...sdk.ValAddress) *StakingKeeperMock + func NewStakingKeeperWeightedMock(t ...MockStakingValidatorData) *StakingKeeperMock + func (s *StakingKeeperMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator + func (s *StakingKeeperMock) GetLastTotalPower(ctx sdk.Context) (power sdkmath.Int) + func (s *StakingKeeperMock) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) int64 + func (s *StakingKeeperMock) GetParams(ctx sdk.Context) stakingtypes.Params + func (s *StakingKeeperMock) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) + func (s *StakingKeeperMock) IterateBondedValidatorsByPower(ctx sdk.Context, ...) + func (s *StakingKeeperMock) IterateLastValidators(ctx sdk.Context, ...) + func (s *StakingKeeperMock) IterateValidators(ctx sdk.Context, ...) + func (s *StakingKeeperMock) Jail(sdk.Context, sdk.ConsAddress) + func (s *StakingKeeperMock) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdkmath.Int + func (s *StakingKeeperMock) Validator(ctx sdk.Context, addr sdk.ValAddress) stakingtypes.ValidatorI + func (s *StakingKeeperMock) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) stakingtypes.ValidatorI + func (s *StakingKeeperMock) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time, endHeight int64) sdk.Iterator + type TestInput struct + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.BaseKeeper + Context sdk.Context + DistKeeper distrkeeper.Keeper + GovKeeper govkeeper.Keeper + GravityKeeper Keeper + GravityStoreKey *storetypes.KVStoreKey + LegacyAmino *codec.LegacyAmino + Marshaler codec.Codec + SlashingKeeper slashingkeeper.Keeper + StakingKeeper stakingkeeper.Keeper + func CreateTestEnv(t *testing.T) TestInput + func SetupFiveValChain(t *testing.T) (TestInput, sdk.Context) + func (input TestInput) AddBalanceToBank(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error + func (input TestInput) AddSendToEthTxsToPool(t *testing.T, ctx sdk.Context, tokenContract gethcommon.Address, ...) + type ValidatorSlashingInfo struct + ConsAddress sdk.ConsAddress + Exists bool + SigningInfo slashingtypes.ValidatorSigningInfo + Validator stakingtypes.Validator Other modules containing this package github.com/peggyjv/gravity-bridge/module github.com/peggyjv/gravity-bridge/module/v2