diff --git a/x/dualstaking/keeper/hooks_test.go b/x/dualstaking/keeper/hooks_test.go index b3aeb259d0..1a949ff863 100644 --- a/x/dualstaking/keeper/hooks_test.go +++ b/x/dualstaking/keeper/hooks_test.go @@ -136,7 +136,7 @@ func TestReDelegateToProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegator.Addr.String(), dualstakingtypes.EMPTY_PROVIDER, - acc.Addr.String(), + operator, dualstakingtypes.EMPTY_PROVIDER_CHAINID, entry.Chain, sdk.NewCoin(ts.TokenDenom(), amount)) @@ -149,12 +149,12 @@ func TestReDelegateToProvider(t *testing.T) { providersRes1, err = ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), true) require.NoError(t, err) - require.Equal(t, acc.Addr.String(), providersRes1.Delegations[0].Provider) + require.Equal(t, operator, providersRes1.Delegations[0].Provider) ts.AdvanceEpoch() epoch = ts.EpochStart() - entry, found = ts.Keepers.Epochstorage.GetStakeEntryForProviderEpoch(ts.Ctx, ts.spec.Index, acc.Addr.String(), epoch) + entry, found = ts.Keepers.Epochstorage.GetStakeEntryForProviderEpoch(ts.Ctx, ts.spec.Index, operator, epoch) require.True(t, found) require.Equal(t, amount, entry.DelegateTotal.Amount) require.Equal(t, amount, entry.Stake.Amount) diff --git a/x/pairing/keeper/msg_server_stake_provider_test.go b/x/pairing/keeper/msg_server_stake_provider_test.go index 5bfbe02331..945e6ff988 100644 --- a/x/pairing/keeper/msg_server_stake_provider_test.go +++ b/x/pairing/keeper/msg_server_stake_provider_test.go @@ -1051,13 +1051,13 @@ func TestVaultOperatorModifyStakeEntry(t *testing.T) { require.True(t, found) // consts for stake entry changes - var ( - STAKE = 1 - ENDPOINTS_GEOLOCATION = 2 - MONIKER = 3 - DELEGATE_LIMIT = 4 - DELEGATE_COMMISSION = 5 - OPERATOR = 6 + const ( + STAKE = iota + 1 + ENDPOINTS_GEOLOCATION + MONIKER + DELEGATE_LIMIT + DELEGATE_COMMISSION + OPERATOR ) tests := []struct { diff --git a/x/pairing/keeper/unstaking_test.go b/x/pairing/keeper/unstaking_test.go index b56cb12d65..f8e6fca736 100644 --- a/x/pairing/keeper/unstaking_test.go +++ b/x/pairing/keeper/unstaking_test.go @@ -65,10 +65,9 @@ func TestVaultOperatorUnstakeAndSlashProposal(t *testing.T) { tests := []struct { name string creator string - valid bool }{ - {"vault unstakes", vault, true}, - {"operator unstakes", operator, true}, + {"vault unstakes", vault}, + {"operator unstakes", operator}, } for _, tt := range tests { @@ -76,11 +75,7 @@ func TestVaultOperatorUnstakeAndSlashProposal(t *testing.T) { err := testutils.SimulateUnstakeProposal(ts.Ctx, ts.Keepers.Pairing, []types.ProviderUnstakeInfo{{ Provider: tt.creator, ChainId: ts.spec.Index, }}, []types.DelegatorSlashing{{}}) - if tt.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } + require.NoError(t, err) }) } } diff --git a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go index 7c510c09cf..37abb5a8c5 100644 --- a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go +++ b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go @@ -32,7 +32,6 @@ func (k Keeper) IprpcProviderRewardEstimation(goCtx context.Context, req *types. providerIprpcCu := uint64(0) totalIprpcCu := uint64(0) - // if input is operator, switch to vault stakeEntry, found := k.epochstorage.GetStakeEntryByAddressCurrent(ctx, specFund.Spec, req.Provider) if !found { continue