Skip to content

Commit

Permalink
go lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBorst committed Mar 6, 2024
1 parent 9b7b436 commit b818c85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/ante/doc.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion app/ante/eth_account_verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions app/ante/eth_set_pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)))
Expand All @@ -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 {
Expand Down

0 comments on commit b818c85

Please sign in to comment.