chore: fix typos and naming inconsistencies (#25001)
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
This commit is contained in:
parent
ef889cdcdf
commit
15cb0ca7ce
@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
// Abnormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
registry := codectypes.NewInterfaceRegistry()
|
||||
types.RegisterInterfaces(registry)
|
||||
|
||||
@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
// Abnormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
cdc := codec.NewProtoCodec(interfaceRegistry)
|
||||
|
||||
@ -69,7 +69,7 @@ func (suite *SimTestSuite) TestWeightedOperations() {
|
||||
cdc := suite.cdc
|
||||
appParams := make(simtypes.AppParams)
|
||||
|
||||
weightesOps := simulation.WeightedOperations(appParams, cdc, suite.txConfig, suite.accountKeeper, suite.bankKeeper)
|
||||
weightedOps := simulation.WeightedOperations(appParams, cdc, suite.txConfig, suite.accountKeeper, suite.bankKeeper)
|
||||
|
||||
// setup 3 accounts
|
||||
s := rand.NewSource(1)
|
||||
@ -85,7 +85,7 @@ func (suite *SimTestSuite) TestWeightedOperations() {
|
||||
{10, types.ModuleName, sdk.MsgTypeURL(&types.MsgMultiSend{})},
|
||||
}
|
||||
|
||||
for i, w := range weightesOps {
|
||||
for i, w := range weightedOps {
|
||||
operationMsg, _, err := w.Op()(r, suite.app.BaseApp, suite.ctx, accs, "")
|
||||
suite.Require().NoError(err)
|
||||
|
||||
@ -99,7 +99,7 @@ func (suite *SimTestSuite) TestWeightedOperations() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgSend tests the normal scenario of a valid message of type TypeMsgSend.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgSend() {
|
||||
// setup 3 accounts
|
||||
s := rand.NewSource(1)
|
||||
@ -129,7 +129,7 @@ func (suite *SimTestSuite) TestSimulateMsgSend() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgSend tests the normal scenario of a valid message of type TypeMsgMultiSend.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgMultiSend() {
|
||||
// setup 3 accounts
|
||||
s := rand.NewSource(1)
|
||||
|
||||
@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
// Abnormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
cdc := codec.NewProtoCodec(interfaceRegistry)
|
||||
|
||||
@ -67,7 +67,7 @@ func (suite *SimTestSuite) TestWeightedOperations() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgSetWithdrawAddress tests the normal scenario of a valid message of type TypeMsgSetWithdrawAddress.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() {
|
||||
// setup 3 accounts
|
||||
s := rand.NewSource(1)
|
||||
@ -97,7 +97,7 @@ func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() {
|
||||
|
||||
// TestSimulateMsgWithdrawDelegatorReward tests the normal scenario of a valid message
|
||||
// of type TypeMsgWithdrawDelegatorReward.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() {
|
||||
// setup 3 accounts
|
||||
s := rand.NewSource(4)
|
||||
@ -143,7 +143,7 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() {
|
||||
|
||||
// TestSimulateMsgWithdrawValidatorCommission tests the normal scenario of a valid message
|
||||
// of type TypeMsgWithdrawValidatorCommission.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgWithdrawValidatorCommission() {
|
||||
suite.testSimulateMsgWithdrawValidatorCommission("atoken")
|
||||
suite.testSimulateMsgWithdrawValidatorCommission("tokenxxx")
|
||||
@ -212,7 +212,7 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName
|
||||
}
|
||||
|
||||
// TestSimulateMsgFundCommunityPool tests the normal scenario of a valid message of type TypeMsgFundCommunityPool.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgFundCommunityPool() {
|
||||
// setup 3 accounts
|
||||
s := rand.NewSource(1)
|
||||
@ -327,7 +327,7 @@ func (suite *SimTestSuite) setupValidatorRewards(valAddress sdk.ValAddress) {
|
||||
decCoins := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyOneDec())}
|
||||
historicalRewards := types.NewValidatorHistoricalRewards(decCoins, 2)
|
||||
suite.Require().NoError(suite.distrKeeper.SetValidatorHistoricalRewards(suite.ctx, valAddress, 2, historicalRewards))
|
||||
// setup current revards
|
||||
// setup current rewards
|
||||
currentRewards := types.NewValidatorCurrentRewards(decCoins, 3)
|
||||
suite.Require().NoError(suite.distrKeeper.SetValidatorCurrentRewards(suite.ctx, valAddress, currentRewards))
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
// Abnormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
cdc := codec.NewProtoCodec(interfaceRegistry)
|
||||
|
||||
@ -172,7 +172,7 @@ func (suite *KeeperTestSuite) TestGetAllContinuousFunds() {
|
||||
|
||||
func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
initialBalance := sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000))
|
||||
initalBalanceCoins := sdk.NewCoins(initialBalance)
|
||||
initialBalanceCoins := sdk.NewCoins(initialBalance)
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -216,11 +216,11 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins)
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initialBalanceCoins)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream).
|
||||
Return(nil).Times(1)
|
||||
|
||||
remainingCoins := initalBalanceCoins.Sub(amountToStream...)
|
||||
remainingCoins := initialBalanceCoins.Sub(amountToStream...)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins).
|
||||
Return(nil).Times(1)
|
||||
},
|
||||
@ -242,11 +242,11 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins)
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initialBalanceCoins)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream).
|
||||
Return(sdkerrors.ErrUnauthorized).Times(1)
|
||||
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, initalBalanceCoins).
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, initialBalanceCoins).
|
||||
Return(nil).Times(1)
|
||||
},
|
||||
expectedErr: "",
|
||||
@ -274,7 +274,7 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// And full amount to be sent to the community pool.
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, initalBalanceCoins).
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, initialBalanceCoins).
|
||||
Return(nil).Times(1)
|
||||
},
|
||||
expectedErr: "",
|
||||
@ -312,14 +312,14 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
err = suite.poolKeeper.ContinuousFunds.Set(suite.ctx, accAddr, fund2)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
amountToStream1 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins)
|
||||
amountToStream2 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.2"), initalBalanceCoins)
|
||||
amountToStream1 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initialBalanceCoins)
|
||||
amountToStream2 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.2"), initialBalanceCoins)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream1).
|
||||
Return(sdkerrors.ErrUnauthorized).Times(1)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr2, amountToStream2).
|
||||
Return(nil).Times(1)
|
||||
|
||||
remainingCoins := initalBalanceCoins.Sub(amountToStream2...)
|
||||
remainingCoins := initialBalanceCoins.Sub(amountToStream2...)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins).
|
||||
Return(nil).Times(1)
|
||||
},
|
||||
@ -358,7 +358,7 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
err = suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr2, fund2)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
amountToStream1 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.8"), initalBalanceCoins) // 800 stake
|
||||
amountToStream1 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.8"), initialBalanceCoins) // 800 stake
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream1).
|
||||
Return(nil).Times(1)
|
||||
},
|
||||
@ -406,11 +406,11 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins)
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initialBalanceCoins)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream).
|
||||
Return(nil).Times(1)
|
||||
|
||||
remainingCoins := initalBalanceCoins.Sub(amountToStream...)
|
||||
remainingCoins := initialBalanceCoins.Sub(amountToStream...)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins).
|
||||
Return(fmt.Errorf("send module error")).Times(1)
|
||||
},
|
||||
@ -433,11 +433,11 @@ func (suite *KeeperTestSuite) TestDistributeFunds() {
|
||||
err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins)
|
||||
amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initialBalanceCoins)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream).
|
||||
Return(nil).Times(1)
|
||||
|
||||
remainingCoins := initalBalanceCoins.Sub(amountToStream...)
|
||||
remainingCoins := initialBalanceCoins.Sub(amountToStream...)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins).
|
||||
Return(nil).Times(1)
|
||||
},
|
||||
|
||||
@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
// Abnormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
cdc := codec.NewProtoCodec(interfaceRegistry)
|
||||
|
||||
@ -150,7 +150,7 @@ func (suite *SimTestSuite) TestWeightedOperations() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgUnjail tests the normal scenario of a valid message of type types.MsgUnjail.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (suite *SimTestSuite) TestSimulateMsgUnjail() {
|
||||
blockTime := time.Now().UTC()
|
||||
ctx := suite.ctx.WithBlockTime(blockTime)
|
||||
|
||||
@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
// Abnormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
interfaceRegistry := codectypes.NewInterfaceRegistry()
|
||||
cryptocodec.RegisterInterfaces(interfaceRegistry)
|
||||
|
||||
@ -160,7 +160,7 @@ func (s *SimTestSuite) TestWeightedOperations() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgCreateValidator tests the normal scenario of a valid message of type TypeMsgCreateValidator.
|
||||
// Abonormal scenarios, where the message are created by an errors are not tested here.
|
||||
// Abnormal scenarios, where the message are created by an errors are not tested here.
|
||||
func (s *SimTestSuite) TestSimulateMsgCreateValidator() {
|
||||
require := s.Require()
|
||||
_, err := s.app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash})
|
||||
@ -184,7 +184,7 @@ func (s *SimTestSuite) TestSimulateMsgCreateValidator() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgCancelUnbondingDelegation tests the normal scenario of a valid message of type TypeMsgCancelUnbondingDelegation.
|
||||
// Abonormal scenarios, where the message is
|
||||
// Abnormal scenarios, where the message is
|
||||
func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() {
|
||||
require := s.Require()
|
||||
blockTime := time.Now().UTC()
|
||||
@ -230,7 +230,7 @@ func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgEditValidator tests the normal scenario of a valid message of type TypeMsgEditValidator.
|
||||
// Abonormal scenarios, where the message is created by an errors are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors are not tested here.
|
||||
func (s *SimTestSuite) TestSimulateMsgEditValidator() {
|
||||
require := s.Require()
|
||||
blockTime := time.Now().UTC()
|
||||
@ -257,7 +257,7 @@ func (s *SimTestSuite) TestSimulateMsgEditValidator() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgDelegate tests the normal scenario of a valid message of type TypeMsgDelegate.
|
||||
// Abonormal scenarios, where the message is created by an errors are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors are not tested here.
|
||||
func (s *SimTestSuite) TestSimulateMsgDelegate() {
|
||||
require := s.Require()
|
||||
blockTime := time.Now().UTC()
|
||||
@ -280,7 +280,7 @@ func (s *SimTestSuite) TestSimulateMsgDelegate() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgUndelegate tests the normal scenario of a valid message of type TypeMsgUndelegate.
|
||||
// Abonormal scenarios, where the message is created by an errors are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors are not tested here.
|
||||
func (s *SimTestSuite) TestSimulateMsgUndelegate() {
|
||||
require := s.Require()
|
||||
blockTime := time.Now().UTC()
|
||||
@ -322,7 +322,7 @@ func (s *SimTestSuite) TestSimulateMsgUndelegate() {
|
||||
}
|
||||
|
||||
// TestSimulateMsgBeginRedelegate tests the normal scenario of a valid message of type TypeMsgBeginRedelegate.
|
||||
// Abonormal scenarios, where the message is created by an errors, are not tested here.
|
||||
// Abnormal scenarios, where the message is created by an errors, are not tested here.
|
||||
func (s *SimTestSuite) TestSimulateMsgBeginRedelegate() {
|
||||
require := s.Require()
|
||||
blockTime := time.Now().UTC()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user