From 2df3abd6a2aeb71f3062edab58227c3d21a39972 Mon Sep 17 00:00:00 2001 From: Daniel Choi <13338103+araskachoi@users.noreply.github.com> Date: Tue, 16 Mar 2021 13:37:32 -0700 Subject: [PATCH] Rpcapi fix - requires Eth namespace (#845) * update join_network docs * add eth as default in apis * update changelog --- CHANGELOG.md | 5 +++++ rpc/apis.go | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c78b3a5..bbb697fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## Unreleased + +### API Breaking +* (eth) [\#845](https://github.com/cosmos/ethermint/pull/845) The `eth` namespace must be included in the list of API's as default to run the rpc server without error. + ## [v0.4.1] - 2021-03-01 ### API Breaking diff --git a/rpc/apis.go b/rpc/apis.go index e2e00675..02b8e0dd 100644 --- a/rpc/apis.go +++ b/rpc/apis.go @@ -34,6 +34,23 @@ func GetAPIs(clientCtx context.CLIContext, selectedApis []string, keys ...ethsec var apis []rpc.API + apis = append(apis, + rpc.API{ + Namespace: EthNamespace, + Version: apiVersion, + Service: ethAPI, + Public: true, + }, + ) + apis = append(apis, + rpc.API{ + Namespace: EthNamespace, + Version: apiVersion, + Service: filters.NewAPI(clientCtx, backend), + Public: true, + }, + ) + for _, api := range selectedApis { switch api { case Web3Namespace: @@ -45,23 +62,6 @@ func GetAPIs(clientCtx context.CLIContext, selectedApis []string, keys ...ethsec Public: true, }, ) - case EthNamespace: - apis = append(apis, - rpc.API{ - Namespace: EthNamespace, - Version: apiVersion, - Service: ethAPI, - Public: true, - }, - ) - apis = append(apis, - rpc.API{ - Namespace: EthNamespace, - Version: apiVersion, - Service: filters.NewAPI(clientCtx, backend), - Public: true, - }, - ) case PersonalNamespace: apis = append(apis, rpc.API{