From 0499ada844c2c69ca9e595c74ee170f8b9ca86df Mon Sep 17 00:00:00 2001 From: Tanmay Date: Thu, 15 Feb 2024 01:32:06 -0500 Subject: [PATCH 1/3] make staking keeper private --- x/crosschain/keeper/keeper.go | 6 +++--- x/crosschain/keeper/msg_server_gas_price_voter.go | 2 +- x/crosschain/keeper/msg_server_vote_inbound_tx_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x/crosschain/keeper/keeper.go b/x/crosschain/keeper/keeper.go index 52b25bb981..745372a48a 100644 --- a/x/crosschain/keeper/keeper.go +++ b/x/crosschain/keeper/keeper.go @@ -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 @@ -49,7 +49,7 @@ func NewKeeper( cdc: cdc, storeKey: storeKey, memKey: memKey, - StakingKeeper: stakingKeeper, + stakingKeeper: stakingKeeper, paramstore: paramstore, authKeeper: authKeeper, bankKeeper: bankKeeper, @@ -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 { diff --git a/x/crosschain/keeper/msg_server_gas_price_voter.go b/x/crosschain/keeper/msg_server_gas_price_voter.go index e91703d4ec..2c56b3f266 100644 --- a/x/crosschain/keeper/msg_server_gas_price_voter.go +++ b/x/crosschain/keeper/msg_server_gas_price_voter.go @@ -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") diff --git a/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go b/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go index c484b585d3..1a8c742c5b 100644 --- a/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go +++ b/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go @@ -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 { @@ -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())) From 96810b3274be3030139cc93375e9dbb0f17264a8 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Thu, 15 Feb 2024 01:35:20 -0500 Subject: [PATCH 2/3] add changelog --- changelog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 5fa64f61a2..361d90366a 100644 --- a/changelog.md +++ b/changelog.md @@ -20,7 +20,8 @@ * [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. - +### Chores +* [1760](https://github.com/zeta-chain/node/pull/1760) - Make staking keeper private in crosschain module ### Fixes * [1678](https://github.com/zeta-chain/node/issues/1678) - clean cached stale block to fix evm outtx hash mismatch From 4ca91845b14aecd4b83011f6f412d297ecd7f0e0 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Thu, 15 Feb 2024 11:46:31 -0500 Subject: [PATCH 3/3] modify chore to refactor --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 361d90366a..9d5213e445 100644 --- a/changelog.md +++ b/changelog.md @@ -20,8 +20,8 @@ * [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. -### Chores * [1760](https://github.com/zeta-chain/node/pull/1760) - Make staking keeper private in crosschain module + ### Fixes * [1678](https://github.com/zeta-chain/node/issues/1678) - clean cached stale block to fix evm outtx hash mismatch