Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

x/evm/keeper: save 24B with Go in-condition variable idiom #828

Merged
merged 5 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ linters:
- staticcheck
- structcheck
- stylecheck
- typecheck
# - typecheck #TODO: enable
- unconvert
- unparam
- unused
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

### Improvements

* (evm) [tharsis#826](https://github.com/tharsis/ethermint/issues/826) Improve allocation of bytes of `tx.To` address.

## [v0.9.0] - 2021-12-01

### State Machine Breaking
Expand Down
16 changes: 0 additions & 16 deletions gometalinter.json

This file was deleted.

5 changes: 1 addition & 4 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"

ethlog "github.com/ethereum/go-ethereum/log"
"github.com/tharsis/ethermint/log"
ethdebug "github.com/tharsis/ethermint/rpc/ethereum/namespaces/debug"
"github.com/tharsis/ethermint/server/config"
srvflags "github.com/tharsis/ethermint/server/flags"
Expand Down Expand Up @@ -405,12 +403,11 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty
}
}

ethlog.Root().SetHandler(log.NewHandler(logger))

var (
httpSrv *http.Server
httpSrvDone chan struct{}
)

if config.JSONRPC.Enable {
genDoc, err := genDocProvider()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyTxHash, hash.String()))
}

if tx.To() != nil {
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyRecipient, tx.To().Hex()))
if to := tx.To(); to != nil {
attrs = append(attrs, sdk.NewAttribute(types.AttributeKeyRecipient, to.Hex()))
}

if response.Failed() {
Expand Down