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

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/ethereum/go…
Browse files Browse the repository at this point in the history
…-ethereum-1.10.16
  • Loading branch information
fedekunze committed Feb 19, 2022
2 parents 482f0e4 + dcd2891 commit 02cfbf6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 0 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pull_request_rules:
name: default
merge:
method: squash
strict: true
commit_message: title+body
- name: backport patches to v0.9.x branch
conditions:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## Unreleased

### Improvements

- (log) [#948](https://github.com/tharsis/ethermint/pull/948) redirect go-ethereum's logs to cosmos-sdk logger.

## [v0.10.0-beta1] - 2022-02-15

### API Breaking
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cosmos/cosmos-sdk v0.45.1
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v3 v3.0.0-beta1
github.com/cosmos/ibc-go/v3 v3.0.0-rc0
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.16
github.com/gogo/protobuf v1.3.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y=
github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w=
github.com/cosmos/ibc-go/v3 v3.0.0-beta1 h1:VyLAJLWtDnWlbXKh0MiO9bQF244X1RcrA9mW503zFlc=
github.com/cosmos/ibc-go/v3 v3.0.0-beta1/go.mod h1:Gxl50rqoJemz7NQ/GNb+m0/U+VNxchMEkq5pMmFEfkk=
github.com/cosmos/ibc-go/v3 v3.0.0-rc0 h1:kQtRMiibviP99ySdmKb8pFkbDt+JQSnW4Swh1NYf0lg=
github.com/cosmos/ibc-go/v3 v3.0.0-rc0/go.mod h1:0G/3QhYWebySAQQgBgQ4y4rqu/UmO3y9ibies3wzpsg=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8=
github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=
Expand Down
14 changes: 14 additions & 0 deletions server/json_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/types"
ethlog "github.com/ethereum/go-ethereum/log"
ethrpc "github.com/ethereum/go-ethereum/rpc"
"github.com/tharsis/ethermint/rpc"

Expand All @@ -20,6 +21,19 @@ import (
func StartJSONRPC(ctx *server.Context, clientCtx client.Context, tmRPCAddr, tmEndpoint string, config config.Config) (*http.Server, chan struct{}, error) {
tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger)

logger := ctx.Logger.With("module", "geth")
ethlog.Root().SetHandler(ethlog.FuncHandler(func(r *ethlog.Record) error {
switch r.Lvl {
case ethlog.LvlTrace, ethlog.LvlDebug:
logger.Debug(r.Msg, r.Ctx...)
case ethlog.LvlInfo, ethlog.LvlWarn:
logger.Info(r.Msg, r.Ctx...)
case ethlog.LvlError, ethlog.LvlCrit:
logger.Error(r.Msg, r.Ctx...)
}
return nil
}))

rpcServer := ethrpc.NewServer()

rpcAPIArr := config.JSONRPC.API
Expand Down

0 comments on commit 02cfbf6

Please sign in to comment.