all: linter (#532)

* add additional linters

* fixes

* rm action
This commit is contained in:
Federico Kunze Küllmer
2021-09-05 11:03:06 +00:00
committed by GitHub
parent c7554e96aa
commit 26c5eabb18
61 changed files with 150 additions and 194 deletions
-3
View File
@@ -128,7 +128,6 @@ func (suite AnteTestSuite) TestAnteHandler() {
for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.ctx = suite.ctx.WithIsCheckTx(tc.reCheckTx).WithIsReCheckTx(tc.reCheckTx)
// expConsumed := params.TxGasContractCreation + params.TxGas
@@ -142,8 +141,6 @@ func (suite AnteTestSuite) TestAnteHandler() {
} else {
suite.Require().Error(err)
}
})
}
}
+2 -4
View File
@@ -1,6 +1,7 @@
package ante
import (
"errors"
"math/big"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -293,7 +294,6 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
homestead,
istanbul,
)
if err != nil {
return ctx, stacktrace.Propagate(err, "failed to deduct transaction costs from user balance")
}
@@ -403,7 +403,6 @@ func NewAccessListDecorator(evmKeeper EVMKeeper) AccessListDecorator {
//
// The AnteHandler will only prepare the access list if Yolov3/Berlin/EIPs 2929 and 2930 are applicable at the current number.
func (ald AccessListDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
params := ald.evmKeeper.GetParams(ctx)
ethCfg := params.ChainConfig.EthereumConfig(ald.evmKeeper.ChainID())
@@ -457,7 +456,6 @@ func NewEthIncrementSenderSequenceDecorator(ak evmtypes.AccountKeeper) EthIncrem
// contract creation, the nonce will be incremented during the transaction execution and not within
// this AnteHandler decorator.
func (issd EthIncrementSenderSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
for i, msg := range tx.GetMsgs() {
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)
if !ok {
@@ -523,7 +521,7 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu
err := tx.ValidateBasic()
// ErrNoSignatures is fine with eth tx
if err != nil && err != sdkerrors.ErrNoSignatures {
if err != nil && !errors.Is(err, sdkerrors.ErrNoSignatures) {
return ctx, stacktrace.Propagate(err, "tx basic validation failed")
}
-11
View File
@@ -52,7 +52,6 @@ func (suite AnteTestSuite) TestEthSigVerificationDecorator() {
} else {
suite.Require().Error(err)
}
})
}
}
@@ -120,7 +119,6 @@ func (suite AnteTestSuite) TestNewEthAccountVerificationDecorator() {
suite.app.AccountKeeper.SetAccount(suite.ctx, acc)
suite.app.EvmKeeper.AddBalance(addr, big.NewInt(1000000))
},
true,
true,
@@ -137,7 +135,6 @@ func (suite AnteTestSuite) TestNewEthAccountVerificationDecorator() {
} else {
suite.Require().Error(err)
}
})
}
}
@@ -185,7 +182,6 @@ func (suite AnteTestSuite) TestEthNonceVerificationDecorator() {
for _, tc := range testCases {
suite.Run(tc.name, func() {
tc.malleate()
_, err := dec.AnteHandle(suite.ctx.WithIsReCheckTx(tc.reCheckTx), tc.tx, false, nextFn)
@@ -194,7 +190,6 @@ func (suite AnteTestSuite) TestEthNonceVerificationDecorator() {
} else {
suite.Require().Error(err)
}
})
}
}
@@ -285,7 +280,6 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {
for _, tc := range testCases {
suite.Run(tc.name, func() {
tc.malleate()
if tc.expPanic {
@@ -301,7 +295,6 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {
} else {
suite.Require().Error(err)
}
})
}
}
@@ -351,7 +344,6 @@ func (suite AnteTestSuite) TestCanTransferDecorator() {
for _, tc := range testCases {
suite.Run(tc.name, func() {
tc.malleate()
_, err := dec.AnteHandle(suite.ctx.WithIsCheckTx(true), tc.tx, false, nextFn)
@@ -412,7 +404,6 @@ func (suite AnteTestSuite) TestAccessListDecorator() {
for _, tc := range testCases {
suite.Run(tc.name, func() {
tc.malleate()
_, err := dec.AnteHandle(suite.ctx.WithIsCheckTx(true), tc.tx, false, nextFn)
@@ -486,7 +477,6 @@ func (suite AnteTestSuite) TestEthIncrementSenderSequenceDecorator() {
for _, tc := range testCases {
suite.Run(tc.name, func() {
tc.malleate()
if tc.expPanic {
@@ -544,7 +534,6 @@ func (suite AnteTestSuite) TestEthSetupContextDecorator() {
} else {
suite.Require().Error(err)
}
})
}
}
+1 -6
View File
@@ -116,10 +116,6 @@ func init() {
DefaultNodeHome = filepath.Join(userHomeDir, ".ethermintd")
}
func init() {
}
const appName = "ethermintd"
var (
@@ -245,7 +241,6 @@ func NewEthermintApp(
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) *EthermintApp {
appCodec := encodingConfig.Marshaler
cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
@@ -483,7 +478,7 @@ func NewEthermintApp(
// create the simulation manager and define the order of the modules for deterministic simulations
//NOTE: this is not required apps that don't use the simulator for fuzz testing
// NOTE: this is not required apps that don't use the simulator for fuzz testing
// transactions
app.sm = module.NewSimulationManager(
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts),
-1
View File
@@ -27,7 +27,6 @@ func NewDefaultGenesisState() simapp.GenesisState {
func (app *EthermintApp) ExportAppStateAndValidators(
forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) {
// Creates context with current height and checks txs for ctx to be usable by start of next block
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})