From e96a4b9f9d24480bdd325816bf3c2099fa9da40b Mon Sep 17 00:00:00 2001 From: Adu Date: Tue, 16 Nov 2021 22:29:51 +0800 Subject: [PATCH] rpc: `debug_intermediateRoots` (#754) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Problem: need to add JSON-RPC endpoint debug_intermediateRoots Closes #715 * currently return emtpy hash * add changelog entry Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- CHANGELOG.md | 1 + rpc/ethereum/namespaces/debug/api.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a27960..c28aba27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [tharsis#740](https://github.com/tharsis/ethermint/pull/740) add JSON_RPC endpoint `personal_initializeWallet` * (rpc) [tharsis#743](https://github.com/tharsis/ethermint/pull/743) add JSON_RPC endpoint `debug_traceBlockByHash` * (rpc) [tharsis#748](https://github.com/tharsis/ethermint/pull/748) add JSON_RPC endpoint `personal_listWallets` +* (rpc) [tharsis#754](https://github.com/tharsis/ethermint/pull/754) add JSON_RPC endpoint `debug_intermediateRoots` ### Bug Fixes diff --git a/rpc/ethereum/namespaces/debug/api.go b/rpc/ethereum/namespaces/debug/api.go index 29ec054a..35c4e598 100644 --- a/rpc/ethereum/namespaces/debug/api.go +++ b/rpc/ethereum/namespaces/debug/api.go @@ -474,3 +474,10 @@ func (a *API) SeedHash(number uint64) (string, error) { return fmt.Sprintf("0x%x", ethash.SeedHash(number)), nil } + +// IntermediateRoots executes a block, and returns a list +// of intermediate roots: the stateroot after each transaction. +func (a *API) IntermediateRoots(hash common.Hash, _ *evmtypes.TraceConfig) ([]common.Hash, error) { + a.logger.Debug("debug_intermediateRoots", "hash", hash) + return ([]common.Hash)(nil), nil +}