From b818c853bfe6dcb44bdf7e29b89f8801c2ae47d0 Mon Sep 17 00:00:00 2001 From: Christian Borst Date: Tue, 5 Mar 2024 22:18:06 -0500 Subject: [PATCH] go lints --- app/ante/doc.go | 3 ++- app/ante/eth_account_verification.go | 5 ++++- app/ante/eth_set_pubkey.go | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/ante/doc.go b/app/ante/doc.go index 73b56f74..d57d8f32 100644 --- a/app/ante/doc.go +++ b/app/ante/doc.go @@ -1,4 +1,5 @@ -/*Package ante defines the SDK auth module's AnteHandler as well as an internal +/* +Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx). During CheckTx, the transaction is passed through a series of diff --git a/app/ante/eth_account_verification.go b/app/ante/eth_account_verification.go index 14a84c0f..668b3c25 100644 --- a/app/ante/eth_account_verification.go +++ b/app/ante/eth_account_verification.go @@ -67,7 +67,10 @@ func (avd EthAccountVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx if acct == nil { acc := ethtypes.ProtoAccount() - acc.SetAddress(from) + err := acc.SetAddress(from) + if err != nil { + return ctx, sdkerrors.Wrap(err, "failed to set address") + } avd.ak.NewAccount(ctx, acc) acct = statedb.NewEmptyAccount() } else if acct.IsContract() { diff --git a/app/ante/eth_set_pubkey.go b/app/ante/eth_set_pubkey.go index 53761dd1..ac46023e 100644 --- a/app/ante/eth_set_pubkey.go +++ b/app/ante/eth_set_pubkey.go @@ -133,6 +133,7 @@ func recoverPubKey(config *params.ChainConfig, blockNumber *big.Int, ethTx *etht signer := ethtypes.NewEIP155Signer(config.ChainID) pubkeyUncompressed, err = eip155PubKey(config, ethTx, signer) case config.IsHomestead(blockNumber): + // nolint: exhaustruct signer := ethtypes.HomesteadSigner{} pubkeyUncompressed, err = homesteadPubKey(ethTx, signer) default: @@ -171,6 +172,7 @@ func eip2930PubKey(config *params.ChainConfig, tx *ethtypes.Transaction, signer switch tx.Type() { case LegacyTxType: if !tx.Protected() { + // nolint: exhaustruct return homesteadPubKey(tx, ethtypes.HomesteadSigner{}) } V = new(big.Int).Sub(V, new(big.Int).Mul(config.ChainID, big.NewInt(2))) @@ -196,6 +198,7 @@ func eip155PubKey(config *params.ChainConfig, tx *ethtypes.Transaction, signer e return nil, ErrTxTypeNotSupported } if !tx.Protected() { + // nolint: exhaustruct return homesteadPubKey(tx, ethtypes.HomesteadSigner{}) } if tx.ChainId().Cmp(config.ChainID) != 0 {