Documentation ¶
Index ¶
- Variables
- func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
- func HandleAddManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.AddManagedCellarsProposal) error
- func HandleRemoveManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.RemoveManagedCellarsProposal) error
- func InitGenesis(ctx sdk.Context, k Keeper, gs types.GenesisState)
- func MakeTestCodec() *codec.LegacyAmino
- func MakeTestMarshaler() codec.Codec
- type AlwaysPanicStakingMock
- func (s AlwaysPanicStakingMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
- func (s AlwaysPanicStakingMock) GetLastTotalPower(ctx sdk.Context) (power sdk.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) PowerReduction(sdk.Context) sdk.Int
- 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
- func (h Hooks) AfterBatchExecutedEvent(ctx sdk.Context, event gravitytypes.BatchExecutedEvent)
- func (h Hooks) AfterContractCallExecutedEvent(ctx sdk.Context, event gravitytypes.ContractCallExecutedEvent)
- func (h Hooks) AfterERC20DeployedEvent(ctx sdk.Context, event gravitytypes.ERC20DeployedEvent)
- func (h Hooks) AfterSendToCosmosEvent(ctx sdk.Context, event gravitytypes.SendToCosmosEvent)
- func (h Hooks) AfterSignerSetExecutedEvent(ctx sdk.Context, event gravitytypes.SignerSetTxExecutedEvent)
- type Keeper
- func (k Keeper) AllocationCommit(c context.Context, msg *types.MsgAllocationCommit) (*types.MsgAllocationCommitResponse, error)
- func (k Keeper) AllocationPrecommit(c context.Context, msg *types.MsgAllocationPrecommit) (*types.MsgAllocationPrecommitResponse, error)
- func (k Keeper) BeginBlocker(ctx sdk.Context)
- func (k Keeper) CommitCellarUpdate(ctx sdk.Context, invalidationNonce uint64, invalidationScope tmbytes.HexBytes)
- func (k Keeper) DeleteAllPrecommits(ctx sdk.Context)
- func (k Keeper) DeleteAllocationCommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address)
- func (k Keeper) DeleteAllocationPrecommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address)
- func (k Keeper) DeleteCellar(ctx sdk.Context, cellarAddr common.Address)
- func (k Keeper) EndBlocker(ctx sdk.Context)
- func (k Keeper) GetAllocationCommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address) (types.Allocation, bool)
- func (k Keeper) GetAllocationPrecommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address) (types.AllocationPrecommit, bool)
- func (k Keeper) GetCellarByID(ctx sdk.Context, id common.Address) (cellar types.Cellar, found bool)
- func (k Keeper) GetCellars(ctx sdk.Context) (cellars []types.Cellar)
- func (k Keeper) GetCommitPeriodStart(ctx sdk.Context) (int64, bool)
- func (k Keeper) GetLatestInvalidationNonce(ctx sdk.Context) uint64
- func (k Keeper) GetParamSet(ctx sdk.Context) types.Params
- func (k Keeper) GetPendingCellarUpdate(ctx sdk.Context, invalidationNonce uint64) (types.CellarUpdate, bool)
- func (k Keeper) GetWinningVotes(ctx sdk.Context, threshold sdk.Dec) (winningVotes []types.RebalanceVote)
- func (k Keeper) HasAllocationCommit(ctx sdk.Context, val sdk.ValAddress) bool
- func (k Keeper) HasAllocationCommitForCellar(ctx sdk.Context, val sdk.ValAddress, cel common.Address) bool
- func (k Keeper) HasAllocationPrecommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address) bool
- func (k Keeper) HasCommitPeriodStart(ctx sdk.Context) bool
- func (k Keeper) HasPendingCellarUpdate(ctx sdk.Context, invalidationNonce uint64) bool
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncrementInvalidationNonce(ctx sdk.Context) uint64
- func (k Keeper) IterateAllocationCommitValidators(ctx sdk.Context, handler func(val sdk.ValAddress) (stop bool))
- func (k Keeper) IterateAllocationCommits(ctx sdk.Context, ...)
- func (k Keeper) IterateAllocationPrecommits(ctx sdk.Context, ...)
- func (k Keeper) IterateCellars(ctx sdk.Context, cb func(cellar types.Cellar) (stop bool))
- func (k Keeper) IterateValidatorAllocationCommits(ctx sdk.Context, val sdk.ValAddress, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) QueryAllocationCommit(c context.Context, req *types.QueryAllocationCommitRequest) (*types.QueryAllocationCommitResponse, error)
- func (k Keeper) QueryAllocationCommits(c context.Context, _ *types.QueryAllocationCommitsRequest) (*types.QueryAllocationCommitsResponse, error)
- func (k Keeper) QueryAllocationPrecommit(c context.Context, req *types.QueryAllocationPrecommitRequest) (*types.QueryAllocationPrecommitResponse, error)
- func (k Keeper) QueryAllocationPrecommits(c context.Context, _ *types.QueryAllocationPrecommitsRequest) (*types.QueryAllocationPrecommitsResponse, error)
- func (k Keeper) QueryCellars(c context.Context, _ *types.QueryCellarsRequest) (*types.QueryCellarsResponse, error)
- func (k Keeper) QueryCommitPeriod(c context.Context, _ *types.QueryCommitPeriodRequest) (*types.QueryCommitPeriodResponse, error)
- func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetAllocationCommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address, ...)
- func (k Keeper) SetAllocationPrecommit(ctx sdk.Context, validatorAddr sdk.ValAddress, cellarAddr common.Address, ...)
- func (k Keeper) SetCellar(ctx sdk.Context, c types.Cellar)
- func (k Keeper) SetCommitPeriodStart(ctx sdk.Context, height int64)
- func (k Keeper) SetLatestInvalidationNonce(ctx sdk.Context, invalidationNonce uint64)
- func (k Keeper) SetPendingCellarUpdate(ctx sdk.Context, cellarUpdate types.CellarUpdate)
- type MockStakingValidatorData
- type StakingKeeperMock
- func (s *StakingKeeperMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
- func (s *StakingKeeperMock) GetLastTotalPower(ctx sdk.Context) (power sdk.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) PowerReduction(sdk.Context) sdk.Int
- func (s *StakingKeeperMock) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
- 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
Constants ¶
This section is empty.
Variables ¶
var ( // ConsPrivKeys generate ed25519 ConsPrivKeys to be used for validator operator keys ConsPrivKeys = []ccrypto.PrivKey{ ed25519.GenPrivKey(), ed25519.GenPrivKey(), ed25519.GenPrivKey(), ed25519.GenPrivKey(), ed25519.GenPrivKey(), } // ConsPubKeys holds the consensus public keys to be used for validator operator keys ConsPubKeys = []ccrypto.PubKey{ ConsPrivKeys[0].PubKey(), ConsPrivKeys[1].PubKey(), ConsPrivKeys[2].PubKey(), ConsPrivKeys[3].PubKey(), ConsPrivKeys[4].PubKey(), } // AccPrivKeys generate secp256k1 pubkeys to be used for account pub keys AccPrivKeys = []ccrypto.PrivKey{ secp256k1.GenPrivKey(), secp256k1.GenPrivKey(), secp256k1.GenPrivKey(), secp256k1.GenPrivKey(), secp256k1.GenPrivKey(), } // AccPubKeys holds the pub keys for the account keys AccPubKeys = []ccrypto.PubKey{ AccPrivKeys[0].PubKey(), AccPrivKeys[1].PubKey(), AccPrivKeys[2].PubKey(), AccPrivKeys[3].PubKey(), AccPrivKeys[4].PubKey(), } // AccAddrs holds the sdk.AccAddresses AccAddrs = []sdk.AccAddress{ sdk.AccAddress(AccPubKeys[0].Address()), sdk.AccAddress(AccPubKeys[1].Address()), sdk.AccAddress(AccPubKeys[2].Address()), sdk.AccAddress(AccPubKeys[3].Address()), sdk.AccAddress(AccPubKeys[4].Address()), } // ValAddrs holds the sdk.ValAddresses ValAddrs = []sdk.ValAddress{ sdk.ValAddress(AccPubKeys[0].Address()), sdk.ValAddress(AccPubKeys[1].Address()), sdk.ValAddress(AccPubKeys[2].Address()), sdk.ValAddress(AccPubKeys[3].Address()), sdk.ValAddress(AccPubKeys[4].Address()), } // EthAddrs holds etheruem addresses EthAddrs = []gethcommon.Address{ gethcommon.BytesToAddress(bytes.Repeat([]byte{byte(1)}, 20)), gethcommon.BytesToAddress(bytes.Repeat([]byte{byte(2)}, 20)), gethcommon.BytesToAddress(bytes.Repeat([]byte{byte(3)}, 20)), gethcommon.BytesToAddress(bytes.Repeat([]byte{byte(4)}, 20)), gethcommon.BytesToAddress(bytes.Repeat([]byte{byte(5)}, 20)), } // TokenContractAddrs holds example token contract addresses TokenContractAddrs = []string{ "0x6b175474e89094c44da98b954eedeac495271d0f", "0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e", "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984", "0xc00e94cb662c3520282e6f5717214004a7f26888", "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", } // InitTokens holds the number of tokens to initialize an account with InitTokens = sdk.TokensFromConsensusPower(110, sdk.DefaultPowerReduction) // InitCoins holds the number of coins to initialize an account with InitCoins = sdk.NewCoins(sdk.NewCoin(TestingStakeParams.BondDenom, InitTokens)) // StakingAmount holds the staking power to start a validator with StakingAmount = sdk.TokensFromConsensusPower(10, sdk.DefaultPowerReduction) // StakingCoins holds the staking coins to start a validator with StakingCoins = sdk.NewCoins(sdk.NewCoin(TestingStakeParams.BondDenom, StakingAmount)) // TestingStakeParams is a set of staking params for testing TestingStakeParams = stakingtypes.Params{ UnbondingTime: 100, MaxValidators: 10, MaxEntries: 10, HistoricalEntries: 10000, BondDenom: "stake", } TestingAllocationParams = types.Params{ VoteThreshold: threshold, VotePeriod: 10, } )
var ( // ModuleBasics is a mock module basic manager for testing ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distribution.AppModuleBasic{}, gov.NewAppModuleBasic( paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, vesting.AppModuleBasic{}, gravity.AppModuleBasic{}, ) )
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis
func HandleAddManagedCellarsProposal ¶
func HandleAddManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.AddManagedCellarsProposal) error
HandleAddManagedCellarsProposal is a handler for executing a passed community cellar addition proposal
func HandleRemoveManagedCellarsProposal ¶
func HandleRemoveManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.RemoveManagedCellarsProposal) error
HandleRemoveManagedCellarsProposal is a handler for executing a passed community cellar removal proposal
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, gs types.GenesisState)
InitGenesis initialize default parameters and the keeper's address to pubkey map
func MakeTestCodec ¶
func MakeTestCodec() *codec.LegacyAmino
MakeTestCodec creates a legacy amino codec for testing
func MakeTestMarshaler ¶
MakeTestMarshaler creates a proto codec for use in testing
Types ¶
type AlwaysPanicStakingMock ¶
type AlwaysPanicStakingMock struct{}
AlwaysPanicStakingMock is a mock staking keeper that panics on usage
func (AlwaysPanicStakingMock) GetBondedValidatorsByPower ¶
func (s AlwaysPanicStakingMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
GetBondedValidatorsByPower implements the interface for staking keeper required by gravity
func (AlwaysPanicStakingMock) GetLastTotalPower ¶
func (s AlwaysPanicStakingMock) GetLastTotalPower(ctx sdk.Context) (power sdk.Int)
GetLastTotalPower implements the interface for staking keeper required by gravity
func (AlwaysPanicStakingMock) GetLastValidatorPower ¶
func (s AlwaysPanicStakingMock) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) int64
GetLastValidatorPower implements the interface for staking keeper required by gravity
func (AlwaysPanicStakingMock) IterateBondedValidatorsByPower ¶
func (s AlwaysPanicStakingMock) IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateBondedValidatorsByPower satisfies the interface
func (AlwaysPanicStakingMock) IterateLastValidators ¶
func (s AlwaysPanicStakingMock) IterateLastValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateLastValidators satisfies the interface
func (AlwaysPanicStakingMock) IterateValidators ¶
func (s AlwaysPanicStakingMock) IterateValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateValidators satisfies the interface
func (AlwaysPanicStakingMock) Jail ¶
func (s AlwaysPanicStakingMock) Jail(sdk.Context, sdk.ConsAddress)
Jail satisfies the interface
func (AlwaysPanicStakingMock) PowerReduction ¶
func (s AlwaysPanicStakingMock) PowerReduction(sdk.Context) sdk.Int
PowerReduction satisfies the interface
func (AlwaysPanicStakingMock) Slash ¶
func (s AlwaysPanicStakingMock) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
Slash satisfies the interface
func (AlwaysPanicStakingMock) Validator ¶
func (s AlwaysPanicStakingMock) Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI
Validator satisfies the interface
func (AlwaysPanicStakingMock) ValidatorByConsAddr ¶
func (s AlwaysPanicStakingMock) ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI
ValidatorByConsAddr satisfies the interface
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (Hooks) AfterBatchExecutedEvent ¶
func (h Hooks) AfterBatchExecutedEvent(ctx sdk.Context, event gravitytypes.BatchExecutedEvent)
func (Hooks) AfterContractCallExecutedEvent ¶
func (h Hooks) AfterContractCallExecutedEvent(ctx sdk.Context, event gravitytypes.ContractCallExecutedEvent)
func (Hooks) AfterERC20DeployedEvent ¶
func (h Hooks) AfterERC20DeployedEvent(ctx sdk.Context, event gravitytypes.ERC20DeployedEvent)
func (Hooks) AfterSendToCosmosEvent ¶
func (h Hooks) AfterSendToCosmosEvent(ctx sdk.Context, event gravitytypes.SendToCosmosEvent)
func (Hooks) AfterSignerSetExecutedEvent ¶
func (h Hooks) AfterSignerSetExecutedEvent(ctx sdk.Context, event gravitytypes.SignerSetTxExecutedEvent)
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the oracle store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, stakingKeeper types.StakingKeeper, gravityKeeper types.GravityKeeper, ) Keeper
NewKeeper creates a new distribution Keeper instance
func (Keeper) AllocationCommit ¶
func (k Keeper) AllocationCommit(c context.Context, msg *types.MsgAllocationCommit) (*types.MsgAllocationCommitResponse, error)
AllocationCommit implements types.MsgServer
func (Keeper) AllocationPrecommit ¶
func (k Keeper) AllocationPrecommit(c context.Context, msg *types.MsgAllocationPrecommit) (*types.MsgAllocationPrecommitResponse, error)
AllocationPrecommit implements types.MsgServer
func (Keeper) BeginBlocker ¶
BeginBlocker is called at the beginning of every block
func (Keeper) CommitCellarUpdate ¶
func (Keeper) DeleteAllPrecommits ¶
DeleteAllPrecommits removes all the prevotes for the current block iteration
func (Keeper) DeleteAllocationCommit ¶
DeleteAllocationCommit deletes the prevote for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) DeleteAllocationPrecommit ¶
DeleteAllocationPrecommit deletes the prevote for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) DeleteCellar ¶
func (Keeper) EndBlocker ¶
func (Keeper) GetAllocationCommit ¶
func (k Keeper) GetAllocationCommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address) (types.Allocation, bool)
GetAllocationCommit gets the prevote for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) GetAllocationPrecommit ¶
func (k Keeper) GetAllocationPrecommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address) (types.AllocationPrecommit, bool)
GetAllocationPrecommit gets the prevote for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) GetCellarByID ¶
func (Keeper) GetCommitPeriodStart ¶
GetCommitPeriodStart returns the vote period start height
func (Keeper) GetLatestInvalidationNonce ¶
func (Keeper) GetParamSet ¶
GetParamSet returns the vote period from the parameters
func (Keeper) GetPendingCellarUpdate ¶
func (Keeper) GetWinningVotes ¶
func (Keeper) HasAllocationCommit ¶
HasAllocationCommit gets the existence of any commit for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) HasAllocationCommitForCellar ¶
func (k Keeper) HasAllocationCommitForCellar(ctx sdk.Context, val sdk.ValAddress, cel common.Address) bool
HasAllocationCommitForCellar gets the prevote for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) HasAllocationPrecommit ¶
func (k Keeper) HasAllocationPrecommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address) bool
HasAllocationPrecommit gets the precommit for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) HasCommitPeriodStart ¶
HasCommitPeriodStart returns true if the vote period start has been set
func (Keeper) HasPendingCellarUpdate ¶
func (Keeper) IncrementInvalidationNonce ¶
func (Keeper) IterateAllocationCommitValidators ¶
func (k Keeper) IterateAllocationCommitValidators(ctx sdk.Context, handler func(val sdk.ValAddress) (stop bool))
IterateAllocationCommitValidators iterates over all validators who have committed allocations
func (Keeper) IterateAllocationCommits ¶
func (k Keeper) IterateAllocationCommits(ctx sdk.Context, handler func(val sdk.ValAddress, cel common.Address, commit types.Allocation) (stop bool))
IterateAllocationCommits iterates over all votes in the store
func (Keeper) IterateAllocationPrecommits ¶
func (k Keeper) IterateAllocationPrecommits(ctx sdk.Context, cb func(val sdk.ValAddress, cel common.Address, precommit types.AllocationPrecommit) (stop bool))
IterateAllocationPrecommits iterates over all prevotes in the store
func (Keeper) IterateCellars ¶
func (Keeper) IterateValidatorAllocationCommits ¶
func (k Keeper) IterateValidatorAllocationCommits(ctx sdk.Context, val sdk.ValAddress, handler func(cellar common.Address, commit types.Allocation) (stop bool))
IterateValidatorAllocationCommits Iterates all of the commits for a provided validator
func (Keeper) QueryAllocationCommit ¶
func (k Keeper) QueryAllocationCommit(c context.Context, req *types.QueryAllocationCommitRequest) (*types.QueryAllocationCommitResponse, error)
QueryAllocationCommit implements QueryServer
func (Keeper) QueryAllocationCommits ¶
func (k Keeper) QueryAllocationCommits(c context.Context, _ *types.QueryAllocationCommitsRequest) (*types.QueryAllocationCommitsResponse, error)
QueryAllocationCommits implements QueryServer
func (Keeper) QueryAllocationPrecommit ¶
func (k Keeper) QueryAllocationPrecommit(c context.Context, req *types.QueryAllocationPrecommitRequest) (*types.QueryAllocationPrecommitResponse, error)
QueryAllocationPrecommit implements QueryServer
func (Keeper) QueryAllocationPrecommits ¶
func (k Keeper) QueryAllocationPrecommits(c context.Context, _ *types.QueryAllocationPrecommitsRequest) (*types.QueryAllocationPrecommitsResponse, error)
QueryAllocationPrecommits implements QueryServer
func (Keeper) QueryCellars ¶
func (k Keeper) QueryCellars(c context.Context, _ *types.QueryCellarsRequest) (*types.QueryCellarsResponse, error)
func (Keeper) QueryCommitPeriod ¶
func (k Keeper) QueryCommitPeriod(c context.Context, _ *types.QueryCommitPeriodRequest) (*types.QueryCommitPeriodResponse, error)
QueryCommitPeriod implements QueryServer
func (Keeper) QueryParams ¶
func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
QueryParams implements QueryServer
func (Keeper) SetAllocationCommit ¶
func (k Keeper) SetAllocationCommit(ctx sdk.Context, val sdk.ValAddress, cel common.Address, allocationCommit types.Allocation)
SetAllocationCommit sets the prevote for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) SetAllocationPrecommit ¶
func (k Keeper) SetAllocationPrecommit(ctx sdk.Context, validatorAddr sdk.ValAddress, cellarAddr common.Address, precommit types.AllocationPrecommit)
SetAllocationPrecommit sets the precommit for a given validator CONTRACT: must provide the validator address here not the delegate address
func (Keeper) SetCommitPeriodStart ¶
SetCommitPeriodStart sets the current vote period start height
func (Keeper) SetLatestInvalidationNonce ¶
func (Keeper) SetPendingCellarUpdate ¶
func (k Keeper) SetPendingCellarUpdate(ctx sdk.Context, cellarUpdate types.CellarUpdate)
type MockStakingValidatorData ¶
type MockStakingValidatorData struct { Operator sdk.ValAddress Power int64 }
MockStakingValidatorData creates mock validator data
type StakingKeeperMock ¶
type StakingKeeperMock struct { BondedValidators []stakingtypes.Validator ValidatorPower map[string]int64 }
StakingKeeperMock is a mock staking keeper for use in the tests
func NewStakingKeeperWeightedMock ¶
func NewStakingKeeperWeightedMock(t ...MockStakingValidatorData) *StakingKeeperMock
NewStakingKeeperWeightedMock creates a new mock staking keeper with some mock validator data
func (*StakingKeeperMock) GetBondedValidatorsByPower ¶
func (s *StakingKeeperMock) GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator
GetBondedValidatorsByPower implements the interface for staking keeper required by gravity
func (*StakingKeeperMock) GetLastTotalPower ¶
func (s *StakingKeeperMock) GetLastTotalPower(ctx sdk.Context) (power sdk.Int)
GetLastTotalPower implements the interface for staking keeper required by gravity
func (*StakingKeeperMock) GetLastValidatorPower ¶
func (s *StakingKeeperMock) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) int64
GetLastValidatorPower implements the interface for staking keeper required by gravity
func (*StakingKeeperMock) GetParams ¶
func (s *StakingKeeperMock) GetParams(ctx sdk.Context) stakingtypes.Params
func (*StakingKeeperMock) GetValidator ¶
func (s *StakingKeeperMock) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
func (*StakingKeeperMock) IterateBondedValidatorsByPower ¶
func (s *StakingKeeperMock) IterateBondedValidatorsByPower(ctx sdk.Context, cb func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateBondedValidatorsByPower staisfies the interface
func (*StakingKeeperMock) IterateLastValidators ¶
func (s *StakingKeeperMock) IterateLastValidators(ctx sdk.Context, cb func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateLastValidators staisfies the interface
func (*StakingKeeperMock) IterateValidators ¶
func (s *StakingKeeperMock) IterateValidators(ctx sdk.Context, cb func(index int64, validator stakingtypes.ValidatorI) (stop bool))
IterateValidators staisfies the interface
func (*StakingKeeperMock) Jail ¶
func (s *StakingKeeperMock) Jail(sdk.Context, sdk.ConsAddress)
Jail satisfies the interface
func (*StakingKeeperMock) PowerReduction ¶
func (s *StakingKeeperMock) PowerReduction(sdk.Context) sdk.Int
PowerReduction satisfies the interface
func (*StakingKeeperMock) Slash ¶
func (s *StakingKeeperMock) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
Slash satisfies the interface
func (*StakingKeeperMock) Validator ¶
func (s *StakingKeeperMock) Validator(ctx sdk.Context, addr sdk.ValAddress) stakingtypes.ValidatorI
Validator staisfies the interface
func (*StakingKeeperMock) ValidatorByConsAddr ¶
func (s *StakingKeeperMock) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) stakingtypes.ValidatorI
ValidatorByConsAddr staisfies the interface
func (*StakingKeeperMock) ValidatorQueueIterator ¶
type TestInput ¶
type TestInput struct { AllocationKeeper Keeper GravityKeeper gravitykeeper.Keeper AccountKeeper authkeeper.AccountKeeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper DistKeeper distrkeeper.Keeper BankKeeper bankkeeper.BaseKeeper GovKeeper govkeeper.Keeper Context sdk.Context Marshaler codec.Codec LegacyAmino *codec.LegacyAmino }
TestInput stores the various keepers required to test gravity
func CreateTestEnv ¶
CreateTestEnv creates the keeper testing environment for gravity