From 4e290d026fbb4b227918db3d238c0210e18af4e9 Mon Sep 17 00:00:00 2001 From: Nita Neou Date: Fri, 11 Mar 2022 04:56:01 +0000 Subject: [PATCH] [rpc] enable publicDebugAPI with config flag --- rpc/rpc.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rpc/rpc.go b/rpc/rpc.go index b51cdb6423..313ccd052d 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -161,21 +161,26 @@ func getAPIs(hmy *hmy.Harmony, debugEnable bool, rateLimiterEnable bool, ratelim NewPublicPoolAPI(hmy, Eth), NewPublicStakingAPI(hmy, V1), NewPublicStakingAPI(hmy, V2), - NewPublicDebugAPI(hmy, V1), - NewPublicDebugAPI(hmy, V2), // Legacy methods (subject to removal) v1.NewPublicLegacyAPI(hmy, "hmy"), eth.NewPublicEthService(hmy, "eth"), v2.NewPublicLegacyAPI(hmy, "hmyv2"), } + publicDebugAPIs := []rpc.API{ + //Public debug API + NewPublicDebugAPI(hmy, V1), + NewPublicDebugAPI(hmy, V2), + } + privateAPIs := []rpc.API{ NewPrivateDebugAPI(hmy, V1), NewPrivateDebugAPI(hmy, V2), } if debugEnable { - return append(publicAPIs, privateAPIs...) + apis := append(publicAPIs, publicDebugAPIs...) + return append(apis, privateAPIs...) } return publicAPIs }