Skip to content

Commit

Permalink
refactor: make staking keeper private (#1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD authored and lumtis committed Feb 19, 2024
1 parent 74ef0f8 commit 970205c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

* [1630](https://github.com/zeta-chain/node/pull/1630) added password prompts for hotkey and tss keyshare in zetaclient
Starting zetaclient now requires two passwords to be input; one for the hotkey and another for the tss key-share.
* [1760](https://github.com/zeta-chain/node/pull/1760) - Make staking keeper private in crosschain module

### Fixes

Expand Down
6 changes: 3 additions & 3 deletions x/crosschain/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type (
storeKey storetypes.StoreKey
memKey storetypes.StoreKey

StakingKeeper types.StakingKeeper
stakingKeeper types.StakingKeeper
paramstore paramtypes.Subspace
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
Expand Down Expand Up @@ -49,7 +49,7 @@ func NewKeeper(
cdc: cdc,
storeKey: storeKey,
memKey: memKey,
StakingKeeper: stakingKeeper,
stakingKeeper: stakingKeeper,
paramstore: paramstore,
authKeeper: authKeeper,
bankKeeper: bankKeeper,
Expand All @@ -71,7 +71,7 @@ func (k Keeper) GetBankKeeper() types.BankKeeper {
}

func (k Keeper) GetStakingKeeper() types.StakingKeeper {
return k.StakingKeeper
return k.stakingKeeper
}

func (k Keeper) GetFungibleKeeper() types.FungibleKeeper {
Expand Down
2 changes: 1 addition & 1 deletion x/crosschain/keeper/msg_server_gas_price_voter.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func medianOfArray(values []uint64) int {

// ResetGasMeterAndConsumeGas reset first the gas meter consumed value to zero and set it back to the new value
// 'gasUsed'
func (k *Keeper) ResetGasMeterAndConsumeGas(ctx sdk.Context, gasUsed uint64) {
func (k Keeper) ResetGasMeterAndConsumeGas(ctx sdk.Context, gasUsed uint64) {
// reset the gas count
ctx.GasMeter().RefundGas(ctx.GasMeter().GasConsumed(), "reset the gas count")
ctx.GasMeter().ConsumeGas(gasUsed, "apply evm transaction")
Expand Down
4 changes: 2 additions & 2 deletions x/crosschain/keeper/msg_server_vote_inbound_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func setObservers(t *testing.T, k *keeper.Keeper, ctx sdk.Context, zk keepertest.ZetaKeepers) []string {
validators := k.StakingKeeper.GetAllValidators(ctx)
validators := k.GetStakingKeeper().GetAllValidators(ctx)

validatorAddressListFormatted := make([]string, len(validators))
for i, validator := range validators {
Expand Down Expand Up @@ -85,7 +85,7 @@ func TestNoDoubleEventProtections(t *testing.T) {
)

// Convert the validator address into a user address.
validators := k.StakingKeeper.GetAllValidators(ctx)
validators := k.GetStakingKeeper().GetAllValidators(ctx)
validatorAddress := validators[0].OperatorAddress
valAddr, _ := sdk.ValAddressFromBech32(validatorAddress)
addresstmp, _ := sdk.AccAddressFromHexUnsafe(hex.EncodeToString(valAddr.Bytes()))
Expand Down

0 comments on commit 970205c

Please sign in to comment.