Documentation
¶
Index ¶
- func GenerateSecp256k1Key() (*ecdsa.PrivateKey, []byte, mitotypes.EthAddress)
- func HexToCompressedPubkey(hexPubkey string) []byte
- func PubkeyToConsAddr(pubkey []byte) sdk.ConsAddress
- type MockEvmEngineKeeper
- type MockSlashingKeeper
- func (m MockSlashingKeeper) AddPubkey(ctx context.Context, pubkey cryptotypes.PubKey) error
- func (m MockSlashingKeeper) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress) error
- func (m MockSlashingKeeper) AfterValidatorCreated(ctx context.Context, consPubKey cryptotypes.PubKey) error
- func (m MockSlashingKeeper) UnjailFromConsAddr(ctx context.Context, consAddr sdk.ConsAddress) error
- type TestKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSecp256k1Key ¶
func GenerateSecp256k1Key() (*ecdsa.PrivateKey, []byte, mitotypes.EthAddress)
GenerateSecp256k1Key generates a new secp256k1 private key and returns the private key, compressed pubkey, and eth address
func HexToCompressedPubkey ¶
HexToCompressedPubkey converts a hex string to compressed pubkey bytes
func PubkeyToConsAddr ¶
func PubkeyToConsAddr(pubkey []byte) sdk.ConsAddress
PubkeyToConsAddr converts a pubkey to a consensus address
Types ¶
type MockEvmEngineKeeper ¶
type MockEvmEngineKeeper struct {
InsertWithdrawalFn func(ctx context.Context, withdrawalAddr common.Address, amountGwei uint64) error
}
MockEvmEngineKeeper is a mock of EvmEngineKeeper interface for testing
func (MockEvmEngineKeeper) InsertWithdrawal ¶
type MockSlashingKeeper ¶
type MockSlashingKeeper struct {
AddPubkeyFn func(ctx context.Context, pubkey cryptotypes.PubKey) error
UnjailFromConsAddrFn func(ctx context.Context, consAddr sdk.ConsAddress) error
AfterValidatorBondedFn func(ctx context.Context, consAddr sdk.ConsAddress) error
AfterValidatorCreatedFn func(ctx context.Context, consPubKey cryptotypes.PubKey) error
}
MockSlashingKeeper is a mock of SlashingKeeper interface for testing
func (MockSlashingKeeper) AddPubkey ¶
func (m MockSlashingKeeper) AddPubkey(ctx context.Context, pubkey cryptotypes.PubKey) error
func (MockSlashingKeeper) AfterValidatorBonded ¶
func (m MockSlashingKeeper) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress) error
func (MockSlashingKeeper) AfterValidatorCreated ¶
func (m MockSlashingKeeper) AfterValidatorCreated(ctx context.Context, consPubKey cryptotypes.PubKey) error
func (MockSlashingKeeper) UnjailFromConsAddr ¶
func (m MockSlashingKeeper) UnjailFromConsAddr(ctx context.Context, consAddr sdk.ConsAddress) error
type TestKeeper ¶
type TestKeeper struct {
Keeper *keeper.Keeper
Ctx sdk.Context
Cdc codec.Codec
StoreKey storetypes.StoreKey
MockSlash *MockSlashingKeeper
MockEvmEng *MockEvmEngineKeeper
}
TestKeeper is a minimal working keeper for testing
func NewTestKeeper ¶
func NewTestKeeper(s *suite.Suite) TestKeeper
NewTestKeeper returns a test keeper with minimal working dependencies
func (TestKeeper) RegisterTestValidator ¶
func (tk TestKeeper) RegisterTestValidator(collateral math.Uint, extraVotingPower math.Uint, jailed bool) types.Validator
RegisterTestValidator is a helper function to register a validator for testing
func (TestKeeper) SetupDefaultTestParams ¶
func (tk TestKeeper) SetupDefaultTestParams() types.Params
SetupDefaultTestParams sets up test parameters with commonly used default values
func (TestKeeper) SetupTestParams ¶
func (tk TestKeeper) SetupTestParams(params types.Params) types.Params
SetupTestParams sets up standard test parameters for tests